Skip to main content

ShowTimePicker

Struct ShowTimePicker 

Source
pub struct ShowTimePicker { /* private fields */ }
Expand description

Shows a dialog containing a Material Design time picker.

The returned future resolves when the dialog is dismissed: to the TimeOfDay the user selected (inside the RouteResult) if they tapped the “OK” button, or to None if they dismissed the dialog or tapped “CANCEL”.

The builder parameter can be used to wrap the dialog widget to add inherited widgets like Localizations.override, Directionality, or MediaQuery.

The initial_entry_mode parameter can be used to determine the initial time entry selection of the picker (either a clock dial or text input).

Optional strings for the help_text, cancel_text, confirm_text, error_invalid_text, hour_label_text and minute_label_text allow you to override the default text used for various parts of the dialog.

The use_root_navigator argument is used to determine whether to push the dialog to the Navigator furthest from or nearest to the given context. By default, use_root_navigator is true and the dialog route created by this method is pushed to the root navigator.

The orientation parameter sets the Orientation to use when displaying the dialog. By default the orientation is derived from the MediaQueryData::size of the ambient MediaQuery.

The empty_initial_input parameter starts the input mode with empty hour and minute fields.

Implementations§

Source§

impl ShowTimePicker

Source

pub fn new(initial_time: TimeOfDay) -> ShowTimePicker

Creates a builder for a Material time picker; Dart’s showTimePicker required argument is the initial time, and every other argument is a setter.

Source

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

Wraps the dialog to add inherited widgets such as localizations, direction or media query.

Source

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

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

Source

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

The color of the modal barrier below the dialog.

Source

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

The semantic label of the dialog’s modal barrier.

Source

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

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

Source

pub fn initial_entry_mode( self, initial_entry_mode: TimePickerEntryMode, ) -> ShowTimePicker

The initial time entry selection: a clock dial or text input. Defaults to TimePickerEntryMode::Dial.

Source

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

The text of the cancel button.

Source

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

The text of the confirm button.

Source

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

The text of the help label.

Source

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

The text of the error for an invalid time.

Source

pub fn hour_label_text( self, hour_label_text: impl Into<String>, ) -> ShowTimePicker

The text of the hour field’s label.

Source

pub fn minute_label_text( self, minute_label_text: impl Into<String>, ) -> ShowTimePicker

The text of the minute field’s label.

Source

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

The route settings passed to the dialog route.

Source

pub fn on_entry_mode_changed( self, on_entry_mode_changed: EntryModeChangeCallback, ) -> ShowTimePicker

Called when the user changes the entry mode.

Source

pub fn orientation(self, orientation: Orientation) -> ShowTimePicker

The orientation of the dialog; defaults to the ambient media query’s.

Source

pub fn switch_to_input_entry_mode_icon( self, switch_to_input_entry_mode_icon: Icon, ) -> ShowTimePicker

The icon that switches to the input entry mode.

Source

pub fn switch_to_timer_entry_mode_icon( self, switch_to_timer_entry_mode_icon: Icon, ) -> ShowTimePicker

The icon that switches to the timer entry mode.

Source

pub fn empty_initial_input(self, empty_initial_input: bool) -> ShowTimePicker

Starts the input mode with empty hour and minute fields.

Source

pub fn show( self, app: &mut App, context: BuildContext, ) -> CompleterFuture<RouteResult> ⓘ

Shows the dialog and returns a future that resolves when it is dismissed.

Auto Trait Implementations§

§

impl !RefUnwindSafe for ShowTimePicker

§

impl !Send for ShowTimePicker

§

impl !Sync for ShowTimePicker

§

impl !UnwindSafe for ShowTimePicker

§

impl Forget for ShowTimePicker

§

impl Freeze for ShowTimePicker
where *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 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, TimePickerEntryMode)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, TimePickerEntryMode)>>: Freeze, *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, PhantomData<String>: Freeze, &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, PhantomData<Shadow>: Freeze,

§

impl Move for ShowTimePicker

§

impl Unpin for ShowTimePicker
where Rc<dyn Fn(&mut App, AnyElement, Option<&Rc<dyn Widget>>) -> Rc<dyn Widget>>: Unpin, *const u8 is !null: Unpin, Rc<dyn Any>: Unpin, Rc<dyn Page>: Unpin, Rc<dyn Fn(&mut App, TimePickerEntryMode)>: Unpin, Rc<dyn Key>: Unpin, &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin,

§

impl UnsafeUnpin for ShowTimePicker
where *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 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, TimePickerEntryMode)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, TimePickerEntryMode)>>: UnsafeUnpin, *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, &'static dyn ColorExtension: UnsafeUnpin, *const RcInner<dyn ColorExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin, PhantomData<Shadow>: 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>