recurrenceExceptionDates property
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.
See also:
- recurrenceRule, which used to generate the recurrence time region based on the rule set.
- RecurrenceProperties, which used to create the recurrence rule based on the values set to these properties.
- SfCalendar.generateRRule, which used to generate recurrence rule based on the RecurrenceProperties values.
- Knowledge base: How to use multiple recurrence rule in special region
- Knowledge base: How to exclude the dates from the recurrence appointments
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;