Skip to main content

ShowDateRangePicker

Struct ShowDateRangePicker 

Source
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

Source

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.

Source

pub fn initial_date_range( self, initial_date_range: DateTimeRange, ) -> ShowDateRangePicker

The range the picker opens with.

Source

pub fn current_date(self, current_date: DateTime) -> ShowDateRangePicker

The current day, highlighted in the day grid; defaults to the calendar delegate’s today.

Source

pub fn initial_entry_mode( self, initial_entry_mode: DatePickerEntryMode, ) -> ShowDateRangePicker

The entry mode the picker opens in. Defaults to DatePickerEntryMode::Calendar.

Source

pub fn help_text(self, help_text: impl Into<String>) -> ShowDateRangePicker

The text of the help label.

Source

pub fn cancel_text(self, cancel_text: impl Into<String>) -> ShowDateRangePicker

The text of the cancel button.

Source

pub fn confirm_text( self, confirm_text: impl Into<String>, ) -> ShowDateRangePicker

The text of the confirm button.

Source

pub fn save_text(self, save_text: impl Into<String>) -> ShowDateRangePicker

The text of the save button.

Source

pub fn error_format_text( self, error_format_text: impl Into<String>, ) -> ShowDateRangePicker

The text of the error for an unparseable date.

Source

pub fn error_invalid_text( self, error_invalid_text: impl Into<String>, ) -> ShowDateRangePicker

The text of the error for an invalid date.

Source

pub fn error_invalid_range_text( self, error_invalid_range_text: impl Into<String>, ) -> ShowDateRangePicker

The text of the error for an invalid range.

Source

pub fn field_start_hint_text( self, field_start_hint_text: impl Into<String>, ) -> ShowDateRangePicker

The hint text of the start field.

Source

pub fn field_end_hint_text( self, field_end_hint_text: impl Into<String>, ) -> ShowDateRangePicker

The hint text of the end field.

Source

pub fn field_start_label_text( self, field_start_label_text: impl Into<String>, ) -> ShowDateRangePicker

The label text of the start field.

Source

pub fn field_end_label_text( self, field_end_label_text: impl Into<String>, ) -> ShowDateRangePicker

The label text of the end field.

Source

pub fn locale(self, locale: Locale) -> ShowDateRangePicker

The locale of the date picker; defaults to the ambient locale.

Source

pub fn barrier_dismissible( self, barrier_dismissible: bool, ) -> ShowDateRangePicker

Whether tapping on the barrier dismisses the dialog. Defaults to true.

Source

pub fn barrier_color(self, barrier_color: Color) -> ShowDateRangePicker

The color of the modal barrier below the dialog.

Source

pub fn barrier_label( self, barrier_label: impl Into<String>, ) -> ShowDateRangePicker

The semantic label of the dialog’s modal barrier.

Source

pub fn use_root_navigator(self, use_root_navigator: bool) -> ShowDateRangePicker

Whether to push the dialog to the root navigator. Defaults to true.

Source

pub fn route_settings( self, route_settings: RouteSettingsRef, ) -> ShowDateRangePicker

The route settings passed to the dialog route.

Source

pub fn text_direction( self, text_direction: TextDirection, ) -> ShowDateRangePicker

The text direction of the date picker; defaults to the ambient direction.

Source

pub fn builder(self, builder: TransitionBuilder) -> ShowDateRangePicker

Wraps the dialog to add inherited widgets such as a theme.

Source

pub fn keyboard_type(self, keyboard_type: TextInputType) -> ShowDateRangePicker

The keyboard type of the input fields. Defaults to TextInputType::DATETIME.

Source

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.

Source

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.

Source

pub fn selectable_day_predicate( self, selectable_day_predicate: SelectableDayForRangePredicate, ) -> ShowDateRangePicker

Which days may be selected.

Source

pub fn calendar_delegate( self, calendar_delegate: Rc<dyn CalendarDelegate>, ) -> ShowDateRangePicker

The calendar the dialog works in. Defaults to the Gregorian calendar.

Source

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.

Auto Trait Implementations§

§

impl !RefUnwindSafe for ShowDateRangePicker

§

impl !Send for ShowDateRangePicker

§

impl !Sync for ShowDateRangePicker

§

impl !UnwindSafe for ShowDateRangePicker

§

impl Forget for ShowDateRangePicker

§

impl Freeze for ShowDateRangePicker
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const RcInner<dyn Any> is !null: Freeze, PhantomData<RcInner<dyn Any>>: Freeze, *const RcInner<dyn Page> is !null: Freeze, PhantomData<RcInner<dyn Page>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool>>: Freeze, *const RcInner<dyn CalendarDelegate> is !null: Freeze, PhantomData<RcInner<dyn CalendarDelegate>>: Freeze,

§

impl Move for ShowDateRangePicker

§

impl Unpin for ShowDateRangePicker
where *const u8 is !null: Unpin, Rc<dyn Any>: Unpin, Rc<dyn Page>: Unpin, Rc<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>>: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool>: Unpin, Rc<dyn CalendarDelegate>: Unpin,

§

impl UnsafeUnpin for ShowDateRangePicker
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const RcInner<dyn Any> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Any>>: UnsafeUnpin, *const RcInner<dyn Page> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Page>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool>>: UnsafeUnpin, *const RcInner<dyn CalendarDelegate> is !null: UnsafeUnpin, PhantomData<RcInner<dyn CalendarDelegate>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>