blackoutDates property
Disables the interactions for certain dates in the month view of SfDateRangePicker.
Defaults to null.
Use DateRangePickerMonthCellStyle.blackoutDateTextStyle or DateRangePickerMonthCellStyle.blackoutDatesDecoration property to customize the appearance of blackout dates in month view.
See also:
- DateRangePickerMonthCellStyle.blackoutDateTextStyle, which used to set text style for the black out date cell in the month view.
- DateRangePickerMonthCellStyle.blackoutDatesDecoration, which used to set the decoration for the black out date cell in the month view.
- specialDates, which is the list of dates to highlight the specific dates in the month view.
- weekendDays, which used to change the week end days in the month view.
- SfDateRangePicker.enablePastDates, which allows to enable the dates that falls before the today date for interaction.
- Knowledge base: How to update blackout dates using onViewChanged callback
- Knowledge base: How to add active dates
- Knowledge base: How to apply theming
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
controller: _pickerController,
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.range,
monthViewSettings:
DateRangePickerMonthViewSettings(blackoutDates: <DateTime>[
DateTime.now().add(Duration(days: 2)),
DateTime.now().add(Duration(days: 3)),
DateTime.now().add(Duration(days: 6)),
DateTime.now().add(Duration(days: 7))
]),
),
),
);
}
Implementation
final List<DateTime>? blackoutDates;