diff --git a/lib/ui/widgets/post_create_form_widget.dart b/lib/ui/widgets/post_create_form_widget.dart index 9249302..0ab9f6a 100644 --- a/lib/ui/widgets/post_create_form_widget.dart +++ b/lib/ui/widgets/post_create_form_widget.dart @@ -231,14 +231,15 @@ class _PostCreateFormWidgetState extends State { /// Pick countdown time Future _pickCountdownTime() async { - final initialDate = - _timeEnd == null ? DateTime.now().add(Duration(minutes: 1)) : _timeEnd; + final yesterday = DateTime.now().subtract(Duration(days: 1)); + + final initialDate = _timeEnd == null ? DateTime.now() : _timeEnd; // Pick date final newDate = await showDatePicker( context: context, initialDate: initialDate, - firstDate: DateTime.now(), + firstDate: yesterday.isBefore(initialDate) ? yesterday : initialDate, lastDate: DateTime.now().add(Duration(days: 5000))); if (newDate == null) return;