selectableDayPredicate property
An selectableDayPredicate callback to decide whether the cell is selectable or not in date range picker.
Note: This callback is not applicable when the navigationMode set as DateRangePickerNavigationMode.scroll.
Defaults to null.
See also: DateRangePickerMonthViewSettings.blackoutDates, which allows to disable interaction for specific dates.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
initialDisplayDate: DateTime(2022),
selectableDayPredicate: (DateTime dateTime) {
if (dateTime != DateTime(2022)) {
return false;
}
return true;
},
),
));
}
Implementation
final DateRangePickerSelectableDayPredicate? selectableDayPredicate;