Reputation: 21
I want to have a time picker where the user can't select a time in the past, like the show date picker where I can select the first date which I want and the last date I want the same thing for the time.
I tried a different package but it's not working. Just one package is time_picker_widget, which accepts to put a condition on the hour, but when I put the condition on minute, it disable all hour. I need to put the condition on a minute because I want the select time to be not in the past and it after at less one hour from now.
Upvotes: 0
Views: 1223
Reputation: 26
you can try day_night_time_picker that allows you to set minMinutes or minHour
and here is an example how to use it:
onPressed: () {
Navigator.of(context).push(
showPicker(
value: TimeOfDay.now(),
context: context,
onChange: (date) {},
minHour: TimeOfDay.now().hour.toDouble(),
minMinute: TimeOfDay.now().minute.toDouble(),
),
);
},
Upvotes: 1