Skip to content

DatePickerTheme

DatePickerTheme #

Customizes the appearance of DatePicker controls across the app.

bgcolor #

bgcolor: ColorValue | None = None

Overrides the default background color of the surface in all descendant DatePicker controls.

cancel_button_style #

cancel_button_style: ButtonStyle | None = None

Overrides the default style of the cancel button of a DatePicker.

confirm_button_style #

confirm_button_style: ButtonStyle | None = None

Overrides the default style of the confirm (OK) button of a DatePicker.

day_bgcolor #

day_bgcolor: ControlStateValue[ColorValue] | None = None

Overrides the default color used to paint the background of the day labels in the grid of the DatePicker.

day_foreground_color #

day_foreground_color: (
    ControlStateValue[ColorValue] | None
) = None

Overrides the default color used to paint the day labels in the grid of the DatePicker.

This will be used instead of the color provided in DatePickerTheme.day_text_style.

day_overlay_color #

day_overlay_color: ControlStateValue[ColorValue] | None = (
    None
)

Overrides the default highlight color that's typically used to indicate that a day in the grid is focused, hovered, or pressed.

day_shape #

day_shape: ControlStateValue[OutlinedBorder] | None = None

Overrides the default shape used to paint the shape decoration of the day labels in the grid of the DatePicker.

If the selected day is the current day, the provided shape with the value of DatePickerTheme.today_bgcolor is used to paint the shape decoration of the day label and the value of DatePickerTheme.today_border_side and DatePickerTheme.today_foreground_color is used to paint the border.

If the selected day is not the current day, the provided shape with the value of DatePickerTheme.day_bgcolor is used to paint the shape decoration of the day label.

day_text_style #

day_text_style: TextStyle | None = None

Overrides the default text style used for each individual day label in the grid of the DatePicker.

The color in DatePickerTheme.day_text_style is not used, DatePickerTheme.day_foreground_color is used instead.

divider_color #

divider_color: ColorValue | None = None

Overrides the default color used to paint the divider in all descendant DatePicker controls.

elevation #

elevation: Number | None = None

Overrides the default value of DatePicker elevation.

header_bgcolor #

header_bgcolor: ColorValue | None = None

Overrides the header's default background fill color.

The DatePicker's header displays the currently selected date.

header_foreground_color #

header_foreground_color: ColorValue | None = None

Overrides the header's default color used for text labels and icons.

The dialog's header displays the currently selected date.

This is used instead of the color property of DatePickerTheme.header_headline_text_style and DatePickerTheme.header_help_text_style.

header_headline_text_style #

header_headline_text_style: TextStyle | None = None

Overrides the header's default headline text style.

The dialog's header displays the currently selected date.

The color of the DatePickerTheme.header_headline_text_style is not used, DatePickerTheme.header_foreground_color is used instead.

header_help_text_style #

header_help_text_style: TextStyle | None = None

Overrides the header's default help text style.

The help text (also referred to as "supporting text" in the Material spec) is usually a prompt to the user at the top of the header (i.e. 'Select date').

The color of the header_help_style is not used, DatePickerTheme.header_foreground_color is used instead.

locale #

locale: Locale | None = None

An optional locale argument can be used to set the locale for the date picker. It defaults to the ambient locale provided by Localizations.

range_picker_bgcolor #

range_picker_bgcolor: ColorValue | None = None

Overrides the default background color for DateRangePicker (TBD).

range_picker_elevation #

range_picker_elevation: Number | None = None

Overrides the default elevation of the full screen DateRangePicker (TBD).

range_picker_header_bgcolor #

range_picker_header_bgcolor: ColorValue | None = None

Overrides the default background fill color for DateRangePicker (TBD).

The dialog's header displays the currently selected date range.

range_picker_header_foreground_color #

range_picker_header_foreground_color: ColorValue | None = (
    None
)

Overrides the default color used for text labels and icons in the header of a full screen DateRangePicker (TBD)

The dialog's header displays the currently selected date range.

This is used instead of any colors provided by range_picker_header_headline_text_style or range_picker_header_help_text_style.

range_picker_header_headline_text_style #

range_picker_header_headline_text_style: (
    TextStyle | None
) = None

Overrides the default text style used for the headline text in the header of a full screen DateRangePicker (TBD).

The dialog's header displays the currently selected date range.

The color of range_picker_header_headline_text_style is not used, range_picker_header_foreground_color is used instead.

range_picker_header_help_text_style #

range_picker_header_help_text_style: TextStyle | None = None

Overrides the default text style used for the help text of the header of a full screen DateRangePicker (TBD).

The help text (also referred to as "supporting text" in the Material spec) is usually a prompt to the user at the top of the header (i.e. 'Select date').

The color of the range_picker_header_help_text_style is not used, range_picker_header_foreground_color is used instead.

range_picker_shape #

range_picker_shape: OutlinedBorder | None = None

Overrides the default overall shape of a full screen DateRangePicker (TBD).

If elevation is greater than zero then a shadow is shown and the shadow's shape mirrors the shape of the dialog.

range_picker_surface_tint_color #

range_picker_surface_tint_color: ColorValue | None = None

Overrides the default color of the surface tint overlay applied to the background color of a full screen DateRangePicker (TBD)'s to indicate elevation.

This is not recommended for use. Material 3 spec introduced a set of tone-based surfaces and surface containers in its ColorScheme, which provide more flexibility. The intention is to eventually remove surface tint color from the framework.

range_selection_bgcolor #

range_selection_bgcolor: ColorValue | None = None

Overrides the default background color used to paint days selected between the start and end dates in a DateRangePicker (TBD).

range_selection_overlay_color #

range_selection_overlay_color: (
    ControlStateValue[ColorValue] | None
) = None

Overrides the default highlight color that's typically used to indicate that a date in the selected range of a DateRangePicker (TBD) is focused, hovered, or pressed.

shadow_color #

shadow_color: ColorValue | None = None

Overrides the default shadow color in all descendant DatePicker controls.

shape #

shape: OutlinedBorder | None = None

Overrides the default value of DatePicker shape.

If elevation is greater than zero then a shadow is shown and the shadow's shape mirrors the shape of the dialog.

surface_tint_color #

surface_tint_color: ColorValue | None = None

Overrides the default surface tint color in all descendant DatePicker controls.

today_bgcolor #

today_bgcolor: ControlStateValue[ColorValue] | None = None

Overrides the default color used to paint the background of the [DatePicker.current_date].[flet.DatePicker.current_date] label in the grid of the DatePicker.

today_border_side #

today_border_side: BorderSide | None = None

Overrides the border used to paint the DatePicker.current_date label in the grid of the DatePicker.

The border side's [BorderSide.color] is not used, DatePickerTheme.today_foreground_color is used instead.

today_foreground_color #

today_foreground_color: (
    ControlStateValue[ColorValue] | None
) = None

Overrides the default color used to paint the DatePicker.current_date label in the grid of the dialog's CalendarDatePicker and the corresponding year in the dialog's YearPicker.

This will be used instead of the color provided in DatePickerTheme.day_text_style.

weekday_text_style #

weekday_text_style: TextStyle | None = None

Overrides the default text style used for the row of weekday labels at the top of the DatePicker grid.

year_bgcolor #

year_bgcolor: ControlStateValue[ColorValue] | None = None

Overrides the default color used to paint the background of the year labels in the year selector of the of the DatePicker.

year_foreground_color #

year_foreground_color: (
    ControlStateValue[ColorValue] | None
) = None

Overrides the default color used to paint the year labels in the year selector of the date picker.

This will be used instead of the color provided in DatePickerTheme.year_text_style.

year_overlay_color #

year_overlay_color: ControlStateValue[ColorValue] | None = (
    None
)

Overrides the default highlight color that's typically used to indicate that a year in the year selector is focused, hovered, or pressed.

year_text_style #

year_text_style: TextStyle | None = None

Overrides the default text style used to paint each of the year entries in the year selector of the DatePicker.

The color of the DatePickerTheme.year_text_style is not used, DatePickerTheme.year_foreground_color
is used instead.