You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
This is my code
var picked = await DateRagePicker.showDatePicker(
context: context,
initialFirstDate: DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[0].departureDate),
initialLastDate: (DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[1].departureDate)),
firstDate: DateTime.now().add(Duration(days: -1)) ,
lastDate: tenYears,
);
when the picker is opened and the user selects the last year and the last date, MonthPickers " assert(!selectedFirstDate.isBefore(firstDate) &&
(selectedLastDate == null || !selectedLastDate.isAfter(lastDate)))" is fired.
The text was updated successfully, but these errors were encountered:
I observed this problem whenever I pick a different year (especially the last year) then tried to select a date. It seems the selectedLastDate becomes greater than the widget.lastDate
The hack I came up with was to
Make a copy of the date_range_picker.dart file
do a conditional if check and re-assign the selectLastDate if it's greater than the widget last date.
Hi,
This is my code
var picked = await DateRagePicker.showDatePicker(
context: context,
initialFirstDate: DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[0].departureDate),
initialLastDate: (DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[1].departureDate)),
firstDate: DateTime.now().add(Duration(days: -1)) ,
lastDate: tenYears,
);
when the picker is opened and the user selects the last year and the last date, MonthPickers " assert(!selectedFirstDate.isBefore(firstDate) &&
(selectedLastDate == null || !selectedLastDate.isAfter(lastDate)))" is fired.
The text was updated successfully, but these errors were encountered: