Skip to main content

DateRangePickerDialog

Struct DateRangePickerDialog 

Source
pub struct DateRangePickerDialog {
Show 23 fields pub key: Option<KeyRef>, pub initial_date_range: Option<DateTimeRange>, pub first_date: DateTime, pub last_date: DateTime, pub current_date_value: Option<DateTime>, pub initial_entry_mode: DatePickerEntryMode, pub cancel_text: Option<String>, pub confirm_text: Option<String>, pub save_text: Option<String>, pub help_text: Option<String>, pub error_invalid_range_text: Option<String>, pub error_format_text: Option<String>, pub error_invalid_text: Option<String>, pub field_start_hint_text: Option<String>, pub field_end_hint_text: Option<String>, pub field_start_label_text: Option<String>, pub field_end_label_text: Option<String>, pub keyboard_type: TextInputType, pub restoration_id: Option<String>, pub switch_to_input_entry_mode_icon: Option<WidgetRef>, pub switch_to_calendar_entry_mode_icon: Option<WidgetRef>, pub selectable_day_predicate: Option<SelectableDayForRangePredicate>, pub calendar_delegate: Rc<dyn CalendarDelegate>,
}
Expand description

A Material-style date range picker dialog.

It is used by ShowDateRangePicker, which should usually be used rather than creating a DateRangePickerDialog directly.

Fields§

§key: Option<KeyRef>§initial_date_range: Option<DateTimeRange>

The date range that the date range picker starts with when it opens.

If an initial date range is provided, DateTimeRange::start and DateTimeRange::end must both fall within the first_date and last_date range.

§first_date: DateTime

The earliest allowable date on the date range.

§last_date: DateTime

The latest allowable date on the date range.

§current_date_value: Option<DateTime>

The current_date value given, if any; the getter truncates it.

§initial_entry_mode: DatePickerEntryMode

The initial mode of date entry method for the date range picker dialog.

§cancel_text: Option<String>

The label on the cancel button for the text input mode.

§confirm_text: Option<String>

The label on the “OK” button for the text input mode.

§save_text: Option<String>

The label on the save button for the fullscreen calendar mode.

§help_text: Option<String>

The label displayed at the top of the dialog.

§error_invalid_range_text: Option<String>

Error text used to indicate the entered date range is invalid.

§error_format_text: Option<String>

Error text used to indicate the entered date format is invalid.

§error_invalid_text: Option<String>

Error text used to indicate that an entered date is outside the allowed range.

§field_start_hint_text: Option<String>

Hint text shown when the start date field is empty.

§field_end_hint_text: Option<String>

Hint text shown when the end date field is empty.

§field_start_label_text: Option<String>

Label used for the start date input field in the input mode.

§field_end_label_text: Option<String>

Label used for the end date input field in the input mode.

§keyboard_type: TextInputType

The keyboard type of the date fields.

§restoration_id: Option<String>

Restoration ID to save and restore the state of the DateRangePickerDialog.

§switch_to_input_entry_mode_icon: Option<WidgetRef>

An optional icon that, when pressed, switches from the calendar to the text input.

§switch_to_calendar_entry_mode_icon: Option<WidgetRef>

An optional icon that, when pressed, switches from the text input to the calendar.

§selectable_day_predicate: Option<SelectableDayForRangePredicate>

Function to provide full control over which DateTime can be selected.

§calendar_delegate: Rc<dyn CalendarDelegate>

The calendar the dialog works in.

Implementations§

Source§

impl DateRangePickerDialog

Source

pub fn new(first_date: DateTime, last_date: DateTime) -> DateRangePickerDialog

Creates a DateRangePickerDialog. Dart’s optional named arguments are the fluent setters.

Source

pub fn current_date(&self, app: &App) -> DateTime

The DateTime representing today. It will be highlighted in the day grid.

Source

pub fn key(self, key: KeyRef) -> DateRangePickerDialog

Dart DateRangePickerDialog(key:).

Source

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

Dart DateRangePickerDialog(initialDateRange:).

Source

pub fn with_current_date(self, current_date: DateTime) -> DateRangePickerDialog

Dart DateRangePickerDialog(currentDate:).

Source

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

Dart DateRangePickerDialog(initialEntryMode:).

Source

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

Dart DateRangePickerDialog(keyboardType:).

Source

pub fn restoration_id( self, restoration_id: impl Into<String>, ) -> DateRangePickerDialog

Dart DateRangePickerDialog(restorationId:).

Source

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

Dart DateRangePickerDialog(selectableDayPredicate:).

Source

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

Dart DateRangePickerDialog(calendarDelegate:).

Trait Implementations§

Source§

impl Clone for DateRangePickerDialog

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DateRangePickerDialog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StatefulWidget for DateRangePickerDialog

Source§

type State = DateRangePickerDialogState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn create_state(&self) -> DateRangePickerDialogState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn debug_check_constructor(&self)

Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See Widget::type_name. A stateful form another widget kind becomes (an animated or status transition widget) names the widget it wraps.

Auto Trait Implementations§

§

impl !RefUnwindSafe for DateRangePickerDialog

§

impl !Send for DateRangePickerDialog

§

impl !Sync for DateRangePickerDialog

§

impl !UnwindSafe for DateRangePickerDialog

§

impl Forget for DateRangePickerDialog

§

impl Freeze for DateRangePickerDialog
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: 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 DateRangePickerDialog

§

impl Unpin for DateRangePickerDialog
where Rc<dyn Key>: Unpin, *const u8 is !null: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&App, DateTime, Option<DateTime>, Option<DateTime>) -> bool>: Unpin, Rc<dyn CalendarDelegate>: Unpin,

§

impl UnsafeUnpin for DateRangePickerDialog
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>