ReactiveTimePicker constructor
ReactiveTimePicker({
- Key? key,
- String? formControlName,
- FormControl<
TimeOfDay> ? formControl, - required ReactiveTimePickerBuilder builder,
- TransitionBuilder? transitionBuilder,
- RouteSettings? routeSettings,
- Widget? child,
- String? cancelText,
- String? confirmText,
- String? helpText,
- String? errorInvalidText,
- String? hourLabelText,
- String? minuteLabelText,
- TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial,
- EntryModeChangeCallback? onEntryModeChanged,
- Offset? anchorPoint,
- String? barrierLabel,
- Color? barrierColor,
- bool barrierDismissible = true,
- Orientation? orientation,
- Icon? switchToInputEntryModeIcon,
- Icon? switchToTimerEntryModeIcon,
Creates a ReactiveTimePicker that wraps the function showTimePicker.
Can optionally provide a formControl to bind this widget to a control.
Can optionally provide a formControlName to bind this ReactiveFormField
to a FormControl.
Must provide one of the arguments formControl or a formControlName,
but not both at the same time.
The parameter transitionBuilder is the equivalent of builder
parameter in the showTimePicker.
For documentation about the various parameters, see the showTimePicker function parameters.
Implementation
ReactiveTimePicker({
super.key,
super.formControlName,
super.formControl,
required ReactiveTimePickerBuilder builder,
TransitionBuilder? transitionBuilder,
bool useRootNavigator = true,
RouteSettings? routeSettings,
Widget? child,
String? cancelText,
String? confirmText,
String? helpText,
String? errorInvalidText,
String? hourLabelText,
String? minuteLabelText,
TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial,
EntryModeChangeCallback? onEntryModeChanged,
Offset? anchorPoint,
String? barrierLabel,
Color? barrierColor,
bool barrierDismissible = true,
Orientation? orientation,
Icon? switchToInputEntryModeIcon,
Icon? switchToTimerEntryModeIcon,
}) : super(
builder: (ReactiveFormFieldState<TimeOfDay, TimeOfDay> field) {
return builder(
field.context,
ReactiveTimePickerDelegate._(
field,
(field) => showTimePicker(
context: field.context,
initialTime: field.value ?? TimeOfDay.now(),
builder: transitionBuilder,
useRootNavigator: useRootNavigator,
initialEntryMode: initialEntryMode,
cancelText: cancelText,
confirmText: confirmText,
helpText: helpText,
errorInvalidText: errorInvalidText,
hourLabelText: hourLabelText,
minuteLabelText: minuteLabelText,
routeSettings: routeSettings,
onEntryModeChanged: onEntryModeChanged,
anchorPoint: anchorPoint,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
barrierDismissible: barrierDismissible,
orientation: orientation,
switchToInputEntryModeIcon: switchToInputEntryModeIcon,
switchToTimerEntryModeIcon: switchToTimerEntryModeIcon,
).then((value) {
if (value != null) {
field.didChange(value);
}
}),
),
child,
);
},
);