recurrenceExceptionDates property

List<DateTime>? recurrenceExceptionDates
getter/setter pair

Delete the occurrence for an recurrence appointment.

An Appointment with recurrenceRule will recur on all the possible dates given by the recurrenceRule.

If it is not null the recurrence appointment occurrence can be deleted and the appointment will not occur on the dates set to this property in Calendar.

Defaults to <DateTime>[].

See also:

Widget build(BuildContext context) {
  return Container(
     child: SfCalendar(
       view: CalendarView.day,
       dataSource: _getCalendarDataSource(),
     ),
   );
 }

class DataSource extends CalendarDataSource {
 DataSource(List<Appointment> source) {
   appointments = source;
 }
}

DataSource _getCalendarDataSource() {
   List<Appointment> appointments = <Appointment>[];
   RecurrenceProperties recurrence =
     RecurrenceProperties(startDate: DateTime.now());
   recurrence.recurrenceType = RecurrenceType.daily;
   recurrence.interval = 2;
   recurrence.recurrenceRange = RecurrenceRange.noEndDate;
   recurrence.recurrenceCount = 10;
   appointments.add(
       Appointment(
           startTime: DateTime.now(),
           endTime: DateTime.now().add(
               Duration(hours: 2)),
           isAllDay: true,
           subject: 'Meeting',
           color: Colors.blue,
           startTimeZone: '',
           notes: '',
           location: '',
           endTimeZone: '',
           recurrenceRule: SfCalendar.generateRRule(
               recurrence, DateTime.now(), DateTime.now().add(
               Duration(hours: 2))),
           recurrenceExceptionDates: [
             DateTime.now().add(Duration(days: 2))
           ]
       ));

   return DataSource(appointments);
 }

Implementation

List<DateTime>? recurrenceExceptionDates;