blackoutDates property

List<DateTime>? blackoutDates
final

Represents a list of dates, which are not eligible for selection in SfCalendar.

Defaults to null.

By default, specified dates are marked with a strike-through. Styling of the blackout dates can be handled using the blackoutDatesTextStyle property in SfCalendar.

See also: *blackoutDatesTextStyle, to customize the blackout dates text in calendar.

  • Knowledge base: (How to update blackout dates using onViewChanged)https://www.syncfusion.com/kb/12368/how-to-update-blackout-dates-using-onviewchanged-callback-in-the-flutter-calendar
  • Knowledge base: (How to add active dates)https://www.syncfusion.com/kb/12073/how-to-add-active-dates-in-the-flutter-calendar
  • Knowledge base: (How to customize the blackout dates )https://www.syncfusion.com/kb/12003/how-to-customize-the-blackout-dates-in-the-flutter-event-calendar-sfcalendar

Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfCalendar(
        view: CalendarView.month,
        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;