specialDates property

List<DateTime>? specialDates
final

In the month view of SfDateRangePicker highlights the unique dates with different style rather than the other dates style.

Defaults to null.

Use DateRangePickerMonthCellStyle.specialDatesTextStyle or DateRangePickerMonthCellStyle.specialDatesDecoration property to customize the appearance of blackout dates in month view.

See also: DateRangePickerMonthCellStyle.specialDatesTextStyle,which used to set text style for the text in special dates cell in the month view. DateRangePickerMonthCellStyle.specialDatesDecoration, which used to set decoration for the special dates cell in the month view.


Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfDateRangePicker(
         controller: _pickerController,
         view: DateRangePickerView.month,
         selectionMode: DateRangePickerSelectionMode.range,
         monthViewSettings:
             DateRangePickerMonthViewSettings(specialDates: <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>? specialDates;