pub struct ShowDateRangePicker { /* private fields */ }Expand description
Shows a full screen modal dialog containing a Material Design date range picker.
The returned future resolves when the user closes the dialog. If the user cancels the
dialog, it resolves with null; otherwise it resolves to the selected DateTimeRange
(inside the RouteResult).
The initial_date_range is the range the picker opens with. The first_date and last_date
are the allowable range of dates. The current_date is highlighted in the day grid; with
none, the delegate’s now() is used.
The initial_entry_mode chooses between the calendar and the text input.
The selectable_day_predicate customizes the days enabled for selection.
Dart’s anchorPoint waits for ShowDialog to take one.
Implementations§
Source§impl ShowDateRangePicker
impl ShowDateRangePicker
Sourcepub fn new(first_date: DateTime, last_date: DateTime) -> ShowDateRangePicker
pub fn new(first_date: DateTime, last_date: DateTime) -> ShowDateRangePicker
Creates a builder for a Material date range picker; Dart’s showDateRangePicker
required arguments are the first and last dates, and every other argument is a setter.
Sourcepub fn initial_date_range(
self,
initial_date_range: DateTimeRange,
) -> ShowDateRangePicker
pub fn initial_date_range( self, initial_date_range: DateTimeRange, ) -> ShowDateRangePicker
The range the picker opens with.
Sourcepub fn current_date(self, current_date: DateTime) -> ShowDateRangePicker
pub fn current_date(self, current_date: DateTime) -> ShowDateRangePicker
The current day, highlighted in the day grid; defaults to the calendar delegate’s today.
Sourcepub fn initial_entry_mode(
self,
initial_entry_mode: DatePickerEntryMode,
) -> ShowDateRangePicker
pub fn initial_entry_mode( self, initial_entry_mode: DatePickerEntryMode, ) -> ShowDateRangePicker
The entry mode the picker opens in. Defaults to DatePickerEntryMode::Calendar.
Sourcepub fn help_text(self, help_text: impl Into<String>) -> ShowDateRangePicker
pub fn help_text(self, help_text: impl Into<String>) -> ShowDateRangePicker
The text of the help label.
Sourcepub fn cancel_text(self, cancel_text: impl Into<String>) -> ShowDateRangePicker
pub fn cancel_text(self, cancel_text: impl Into<String>) -> ShowDateRangePicker
The text of the cancel button.
Sourcepub fn confirm_text(
self,
confirm_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn confirm_text( self, confirm_text: impl Into<String>, ) -> ShowDateRangePicker
The text of the confirm button.
Sourcepub fn save_text(self, save_text: impl Into<String>) -> ShowDateRangePicker
pub fn save_text(self, save_text: impl Into<String>) -> ShowDateRangePicker
The text of the save button.
Sourcepub fn error_format_text(
self,
error_format_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn error_format_text( self, error_format_text: impl Into<String>, ) -> ShowDateRangePicker
The text of the error for an unparseable date.
Sourcepub fn error_invalid_text(
self,
error_invalid_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn error_invalid_text( self, error_invalid_text: impl Into<String>, ) -> ShowDateRangePicker
The text of the error for an invalid date.
Sourcepub fn error_invalid_range_text(
self,
error_invalid_range_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn error_invalid_range_text( self, error_invalid_range_text: impl Into<String>, ) -> ShowDateRangePicker
The text of the error for an invalid range.
Sourcepub fn field_start_hint_text(
self,
field_start_hint_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn field_start_hint_text( self, field_start_hint_text: impl Into<String>, ) -> ShowDateRangePicker
The hint text of the start field.
Sourcepub fn field_end_hint_text(
self,
field_end_hint_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn field_end_hint_text( self, field_end_hint_text: impl Into<String>, ) -> ShowDateRangePicker
The hint text of the end field.
Sourcepub fn field_start_label_text(
self,
field_start_label_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn field_start_label_text( self, field_start_label_text: impl Into<String>, ) -> ShowDateRangePicker
The label text of the start field.
Sourcepub fn field_end_label_text(
self,
field_end_label_text: impl Into<String>,
) -> ShowDateRangePicker
pub fn field_end_label_text( self, field_end_label_text: impl Into<String>, ) -> ShowDateRangePicker
The label text of the end field.
Sourcepub fn locale(self, locale: Locale) -> ShowDateRangePicker
pub fn locale(self, locale: Locale) -> ShowDateRangePicker
The locale of the date picker; defaults to the ambient locale.
Sourcepub fn barrier_dismissible(
self,
barrier_dismissible: bool,
) -> ShowDateRangePicker
pub fn barrier_dismissible( self, barrier_dismissible: bool, ) -> ShowDateRangePicker
Whether tapping on the barrier dismisses the dialog. Defaults to true.
Sourcepub fn barrier_color(self, barrier_color: Color) -> ShowDateRangePicker
pub fn barrier_color(self, barrier_color: Color) -> ShowDateRangePicker
The color of the modal barrier below the dialog.
Sourcepub fn barrier_label(
self,
barrier_label: impl Into<String>,
) -> ShowDateRangePicker
pub fn barrier_label( self, barrier_label: impl Into<String>, ) -> ShowDateRangePicker
The semantic label of the dialog’s modal barrier.
Whether to push the dialog to the root navigator. Defaults to true.
Sourcepub fn route_settings(
self,
route_settings: RouteSettingsRef,
) -> ShowDateRangePicker
pub fn route_settings( self, route_settings: RouteSettingsRef, ) -> ShowDateRangePicker
The route settings passed to the dialog route.
Sourcepub fn text_direction(
self,
text_direction: TextDirection,
) -> ShowDateRangePicker
pub fn text_direction( self, text_direction: TextDirection, ) -> ShowDateRangePicker
The text direction of the date picker; defaults to the ambient direction.
Sourcepub fn builder(self, builder: TransitionBuilder) -> ShowDateRangePicker
pub fn builder(self, builder: TransitionBuilder) -> ShowDateRangePicker
Wraps the dialog to add inherited widgets such as a theme.
Sourcepub fn keyboard_type(self, keyboard_type: TextInputType) -> ShowDateRangePicker
pub fn keyboard_type(self, keyboard_type: TextInputType) -> ShowDateRangePicker
The keyboard type of the input fields. Defaults to TextInputType::DATETIME.
Sourcepub fn switch_to_input_entry_mode_icon<K>(
self,
switch_to_input_entry_mode_icon: impl IntoWidget<K>,
) -> ShowDateRangePicker
pub fn switch_to_input_entry_mode_icon<K>( self, switch_to_input_entry_mode_icon: impl IntoWidget<K>, ) -> ShowDateRangePicker
The icon that switches to the input entry mode.
Sourcepub fn switch_to_calendar_entry_mode_icon<K>(
self,
switch_to_calendar_entry_mode_icon: impl IntoWidget<K>,
) -> ShowDateRangePicker
pub fn switch_to_calendar_entry_mode_icon<K>( self, switch_to_calendar_entry_mode_icon: impl IntoWidget<K>, ) -> ShowDateRangePicker
The icon that switches to the calendar entry mode.
Sourcepub fn selectable_day_predicate(
self,
selectable_day_predicate: SelectableDayForRangePredicate,
) -> ShowDateRangePicker
pub fn selectable_day_predicate( self, selectable_day_predicate: SelectableDayForRangePredicate, ) -> ShowDateRangePicker
Which days may be selected.
Sourcepub fn calendar_delegate(
self,
calendar_delegate: Rc<dyn CalendarDelegate>,
) -> ShowDateRangePicker
pub fn calendar_delegate( self, calendar_delegate: Rc<dyn CalendarDelegate>, ) -> ShowDateRangePicker
The calendar the dialog works in. Defaults to the Gregorian calendar.
Sourcepub fn show(
self,
app: &mut App,
context: BuildContext,
) -> CompleterFuture<RouteResult> ⓘ
pub fn show( self, app: &mut App, context: BuildContext, ) -> CompleterFuture<RouteResult> ⓘ
Shows the dialog and returns a future that resolves when the user closes it.