pub struct TimePickerDialog {Show 15 fields
pub key: Option<KeyRef>,
pub initial_time: TimeOfDay,
pub cancel_text: Option<String>,
pub confirm_text: Option<String>,
pub help_text: Option<String>,
pub error_invalid_text: Option<String>,
pub hour_label_text: Option<String>,
pub minute_label_text: Option<String>,
pub restoration_id: Option<String>,
pub initial_entry_mode: TimePickerEntryMode,
pub orientation: Option<Orientation>,
pub on_entry_mode_changed: Option<EntryModeChangeCallback>,
pub switch_to_input_entry_mode_icon: Option<WidgetRef>,
pub switch_to_timer_entry_mode_icon: Option<WidgetRef>,
pub empty_initial_input: bool,
}Expand description
A Material Design time picker designed to appear inside a popup dialog.
Pass this widget to ShowDialog. The value returned by
ShowDialog is the selected TimeOfDay if the user taps the “OK”
button, or null if the user taps the “CANCEL” button. The selected time is reported by
popping the navigator with the selected time.
Use ShowTimePicker to show the dialog.
Fields§
§key: Option<KeyRef>§initial_time: TimeOfDayThe time initially selected when the dialog is shown.
cancel_text: Option<String>Optionally provide your own text for the cancel button.
If null, the button uses MaterialLocalizations::cancel_button_label.
confirm_text: Option<String>Optionally provide your own text for the confirm button.
If null, the button uses MaterialLocalizations::ok_button_label.
help_text: Option<String>Optionally provide your own help text to the header of the time picker.
error_invalid_text: Option<String>Optionally provide your own validation error text.
hour_label_text: Option<String>Optionally provide your own hour label text.
minute_label_text: Option<String>Optionally provide your own minute label text.
restoration_id: Option<String>Restoration ID to save and restore the state of the TimePickerDialog.
If it is non-null, the time picker will persist and restore the selected time and whether the dialog was in the dial or input entry mode.
The state of this widget is persisted in a [RestorationBucket] claimed from
the surrounding [RestorationScope] using the provided restoration ID.
initial_entry_mode: TimePickerEntryModeThe entry mode for the picker. Whether it’s text input or a dial.
orientation: Option<Orientation>The optional 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. If the aspect of the size is tall, then Orientation::Portrait is
used, if the size is wide, then Orientation::Landscape is used.
Use this parameter to override the default and force the dialog to appear in either
portrait or landscape mode regardless of the aspect of the [MediaQueryData::size].
on_entry_mode_changed: Option<EntryModeChangeCallback>Callback called when the selected entry mode is changed.
switch_to_input_entry_mode_icon: Option<WidgetRef>Optionally provide your own icon for the icon button used to switch the mode to input.
switch_to_timer_entry_mode_icon: Option<WidgetRef>Optionally provide your own icon for the icon button used to switch the mode to dial.
empty_initial_input: boolWhether the input mode should start empty.
If true, the hour and minute fields start empty and display hints for the expected values.
Implementations§
Source§impl TimePickerDialog
impl TimePickerDialog
Sourcepub fn new(initial_time: TimeOfDay) -> TimePickerDialog
pub fn new(initial_time: TimeOfDay) -> TimePickerDialog
Creates a Material Design time picker.
Dart’s named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> TimePickerDialog
pub fn key(self, key: KeyRef) -> TimePickerDialog
Dart TimePickerDialog(key:).
Sourcepub fn cancel_text(self, cancel_text: impl Into<String>) -> TimePickerDialog
pub fn cancel_text(self, cancel_text: impl Into<String>) -> TimePickerDialog
Dart TimePickerDialog(cancelText:).
Sourcepub fn confirm_text(self, confirm_text: impl Into<String>) -> TimePickerDialog
pub fn confirm_text(self, confirm_text: impl Into<String>) -> TimePickerDialog
Dart TimePickerDialog(confirmText:).
Sourcepub fn help_text(self, help_text: impl Into<String>) -> TimePickerDialog
pub fn help_text(self, help_text: impl Into<String>) -> TimePickerDialog
Dart TimePickerDialog(helpText:).
Sourcepub fn error_invalid_text(
self,
error_invalid_text: impl Into<String>,
) -> TimePickerDialog
pub fn error_invalid_text( self, error_invalid_text: impl Into<String>, ) -> TimePickerDialog
Dart TimePickerDialog(errorInvalidText:).
Sourcepub fn hour_label_text(
self,
hour_label_text: impl Into<String>,
) -> TimePickerDialog
pub fn hour_label_text( self, hour_label_text: impl Into<String>, ) -> TimePickerDialog
Dart TimePickerDialog(hourLabelText:).
Sourcepub fn minute_label_text(
self,
minute_label_text: impl Into<String>,
) -> TimePickerDialog
pub fn minute_label_text( self, minute_label_text: impl Into<String>, ) -> TimePickerDialog
Dart TimePickerDialog(minuteLabelText:).
Sourcepub fn restoration_id(
self,
restoration_id: impl Into<String>,
) -> TimePickerDialog
pub fn restoration_id( self, restoration_id: impl Into<String>, ) -> TimePickerDialog
Dart TimePickerDialog(restorationId:).
Sourcepub fn initial_entry_mode(
self,
initial_entry_mode: TimePickerEntryMode,
) -> TimePickerDialog
pub fn initial_entry_mode( self, initial_entry_mode: TimePickerEntryMode, ) -> TimePickerDialog
Dart TimePickerDialog(initialEntryMode:).
Sourcepub fn orientation(self, orientation: Orientation) -> TimePickerDialog
pub fn orientation(self, orientation: Orientation) -> TimePickerDialog
Dart TimePickerDialog(orientation:).
Sourcepub fn on_entry_mode_changed(
self,
on_entry_mode_changed: EntryModeChangeCallback,
) -> TimePickerDialog
pub fn on_entry_mode_changed( self, on_entry_mode_changed: EntryModeChangeCallback, ) -> TimePickerDialog
Dart TimePickerDialog(onEntryModeChanged:).
Sourcepub fn switch_to_input_entry_mode_icon(self, icon: Icon) -> TimePickerDialog
pub fn switch_to_input_entry_mode_icon(self, icon: Icon) -> TimePickerDialog
Dart TimePickerDialog(switchToInputEntryModeIcon:).
Sourcepub fn switch_to_timer_entry_mode_icon(self, icon: Icon) -> TimePickerDialog
pub fn switch_to_timer_entry_mode_icon(self, icon: Icon) -> TimePickerDialog
Dart TimePickerDialog(switchToTimerEntryModeIcon:).
Sourcepub fn empty_initial_input(self, empty_initial_input: bool) -> TimePickerDialog
pub fn empty_initial_input(self, empty_initial_input: bool) -> TimePickerDialog
Dart TimePickerDialog(emptyInitialInput:).
Trait Implementations§
Source§impl Clone for TimePickerDialog
impl Clone for TimePickerDialog
Source§impl Debug for TimePickerDialog
impl Debug for TimePickerDialog
Source§impl StatefulWidget for TimePickerDialog
impl StatefulWidget for TimePickerDialog
Source§type State = TimePickerDialogState
type State = TimePickerDialogState
Source§fn create_state(&self) -> TimePickerDialogState
fn create_state(&self) -> TimePickerDialogState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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 as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
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 TimePickerDialog
impl !Send for TimePickerDialog
impl !Sync for TimePickerDialog
impl !UnwindSafe for TimePickerDialog
impl Forget for TimePickerDialog
impl Freeze for TimePickerDialogwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<dyn Fn(&mut App, TimePickerEntryMode)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, TimePickerEntryMode)>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for TimePickerDialog
impl Unpin for TimePickerDialog
impl UnsafeUnpin for TimePickerDialogwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, TimePickerEntryMode)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, TimePickerEntryMode)>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.