flutter_datetime_picker
flutter_datetime_picker copied to clipboard
DatePicker.showDateTimePicker maxTime not working
Hi I noticed that DatePicker.showDateTimePicker is not blocking future dates when I set maxTime: DateTime.now(),
Here is the code:
return TextButton(
onPressed: () {
DatePicker.showDateTimePicker(
context,
showTitleActions: true,
minTime: DateTime(2021, 9, 1),
maxTime: DateTime.now(),
theme: DatePickerTheme(
cancelStyle: Theme.of(context).textTheme.bodyText1!,
doneStyle: Theme.of(context).textTheme.bodyText1!,
itemStyle: Theme.of(context).textTheme.bodyText2!,
),
onChanged: (date) {
print('change $date');
},
onConfirm: (date) {
print('confirm $date');
},
currentTime: DateTime.now(),
);
},
child: const Text(
'show date time picker (Chinese)',
style: TextStyle(color: Colors.blue),
));
And an image

It should be showing only DateTime.now() as max date/ time
Thanks in advance!
I can confirm this issue still exists.
@rasekoli Have you fixed this, I can still reproduce it