Shows a dialog containing a material design time picker.
The returned Future resolves to the time 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:
showTimePicker(
initialTime: new TimeOfDay.now(),
context: context
);
See also:
Source
Future<TimeOfDay> showTimePicker({ BuildContext context, TimeOfDay initialTime }) async { assert(initialTime != null); return await showDialog( context: context, child: new _TimePickerDialog(initialTime: initialTime) ); }