How can we allow only selection of 30 days with any start date in DateRangePicker
?
Only firstDate
and lastDate
can be provided, which can be restricted to 30 days starting from the provided firstDate
only.
How can we allow only selection of 30 days with any start date in DateRangePicker
?
Only firstDate
and lastDate
can be provided, which can be restricted to 30 days starting from the provided firstDate
only.
Add below package to restrict certain dates in DateRangePicker
calendar_date_picker2: ^0.5.2
there is "selectableDayPredicate" function available for DateRangePicker.
You can simply pass list of dates which you wants to disable in selection in range.
final picked = await showDateRangePicker(
context: context,
firstDate: (DateTime.now()).subtract(Duration(days: 30)),
lastDate: DateTime.now(),
currentDate: DateTime.now(),
saveText: 'Done',
);