showDurationPicker function
Future<Duration?>
showDurationPicker({
- required BuildContext context,
- required Duration initialTime,
- BaseUnit baseUnit = BaseUnit.minute,
- BoxDecoration? decoration,
- Duration? upperBound,
- Duration? lowerBound,
Shows a dialog containing the duration picker.
The returned Future resolves to the duration selected by the user when the user closes the dialog. If the user cancels the dialog, null is returned.
To show a dialog with initialTime
equal to the current time:
showDurationPicker(
initialTime: new Duration.now(),
context: context,
);
Implementation
Future<Duration?> showDurationPicker({
required BuildContext context,
required Duration initialTime,
BaseUnit baseUnit = BaseUnit.minute,
BoxDecoration? decoration,
Duration? upperBound,
Duration? lowerBound,
}) async {
return showDialog<Duration>(
context: context,
builder: (BuildContext context) => DurationPickerDialog(
initialTime: initialTime,
baseUnit: baseUnit,
decoration: decoration,
upperBound: upperBound,
lowerBound: lowerBound,
),
);
}