recurrenceExceptionDates property Null safety

List<DateTime>? recurrenceExceptionDates
final

Used to restrict the occurrence for an recurrence region.

TimeRegion will recur on all possible dates given by the recurrenceRule. If it is not empty, then recurrence region not applied to specified collection of dates in recurrenceExceptionDates.

 Widget build(BuildContext context) {
   return Container(
     child: SfCalendar(
       view: CalendarView.week,
       specialRegions: _getTimeRegions(),
     ),
   );
 }

 List<TimeRegion> _getTimeRegions() {
   final List<TimeRegion> regions = <TimeRegion>[];
   regions.add(TimeRegion(
       startTime: DateTime.now(),
       endTime: DateTime.now().add(Duration(hours: 1)),
       enablePointerInteraction: false,
       timeZone: 'Eastern Standard Time',
       recurrenceRule: 'FREQ=DAILY;INTERVAL=1',
       textStyle: TextStyle(color: Colors.black45, fontSize: 15),
       color: Colors.grey.withOpacity(0.2),
       recurrenceExceptionDates: [
             DateTime.now().add(Duration(days: 2))
           ],
       text: 'Break'));

   return regions;
 }

Implementation

final List<DateTime>? recurrenceExceptionDates;