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
impl ShowTimePicker
Sourcepub fn new(initial_time: TimeOfDay) -> ShowTimePicker
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.
Sourcepub fn builder(self, builder: TransitionBuilder) -> ShowTimePicker
pub fn builder(self, builder: TransitionBuilder) -> ShowTimePicker
Wraps the dialog to add inherited widgets such as localizations, direction or media query.
Sourcepub fn barrier_dismissible(self, barrier_dismissible: bool) -> ShowTimePicker
pub fn barrier_dismissible(self, barrier_dismissible: bool) -> ShowTimePicker
Whether tapping on the barrier dismisses the dialog. Defaults to true.
Sourcepub fn barrier_color(self, barrier_color: Color) -> ShowTimePicker
pub fn barrier_color(self, barrier_color: Color) -> ShowTimePicker
The color of the modal barrier below the dialog.
Sourcepub fn barrier_label(self, barrier_label: impl Into<String>) -> ShowTimePicker
pub fn barrier_label(self, barrier_label: impl Into<String>) -> ShowTimePicker
The semantic label of the dialog’s modal barrier.
Whether to push the dialog to the root navigator. Defaults to true.
Sourcepub fn initial_entry_mode(
self,
initial_entry_mode: TimePickerEntryMode,
) -> ShowTimePicker
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.
Sourcepub fn cancel_text(self, cancel_text: impl Into<String>) -> ShowTimePicker
pub fn cancel_text(self, cancel_text: impl Into<String>) -> ShowTimePicker
The text of the cancel button.
Sourcepub fn confirm_text(self, confirm_text: impl Into<String>) -> ShowTimePicker
pub fn confirm_text(self, confirm_text: impl Into<String>) -> ShowTimePicker
The text of the confirm button.
Sourcepub fn help_text(self, help_text: impl Into<String>) -> ShowTimePicker
pub fn help_text(self, help_text: impl Into<String>) -> ShowTimePicker
The text of the help label.
Sourcepub fn error_invalid_text(
self,
error_invalid_text: impl Into<String>,
) -> ShowTimePicker
pub fn error_invalid_text( self, error_invalid_text: impl Into<String>, ) -> ShowTimePicker
The text of the error for an invalid time.
Sourcepub fn hour_label_text(
self,
hour_label_text: impl Into<String>,
) -> ShowTimePicker
pub fn hour_label_text( self, hour_label_text: impl Into<String>, ) -> ShowTimePicker
The text of the hour field’s label.
Sourcepub fn minute_label_text(
self,
minute_label_text: impl Into<String>,
) -> ShowTimePicker
pub fn minute_label_text( self, minute_label_text: impl Into<String>, ) -> ShowTimePicker
The text of the minute field’s label.
Sourcepub fn route_settings(self, route_settings: RouteSettingsRef) -> ShowTimePicker
pub fn route_settings(self, route_settings: RouteSettingsRef) -> ShowTimePicker
The route settings passed to the dialog route.
Sourcepub fn on_entry_mode_changed(
self,
on_entry_mode_changed: EntryModeChangeCallback,
) -> ShowTimePicker
pub fn on_entry_mode_changed( self, on_entry_mode_changed: EntryModeChangeCallback, ) -> ShowTimePicker
Called when the user changes the entry mode.
Sourcepub fn orientation(self, orientation: Orientation) -> ShowTimePicker
pub fn orientation(self, orientation: Orientation) -> ShowTimePicker
The orientation of the dialog; defaults to the ambient media query’s.
Sourcepub fn switch_to_input_entry_mode_icon(
self,
switch_to_input_entry_mode_icon: Icon,
) -> ShowTimePicker
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.
Sourcepub fn switch_to_timer_entry_mode_icon(
self,
switch_to_timer_entry_mode_icon: Icon,
) -> ShowTimePicker
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.
Sourcepub fn empty_initial_input(self, empty_initial_input: bool) -> ShowTimePicker
pub fn empty_initial_input(self, empty_initial_input: bool) -> ShowTimePicker
Starts the input mode with empty hour and minute fields.
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 it is dismissed.