endDate property

DateTime? endDate
getter/setter pair

Defines the end date for the Appointment to end it's recurrence.

The Appointment ends to recur on the date set to this property, when the recurrenceRange set as RecurrenceRange.endDate.

Note: it is applicable only when the recurrenceRange set as RecurrenceRange.endDate.

Defaults to null.

See also:

  • startDate, on or after the given date the recurring will be start.
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.endDate = DateTime.now().add(Duration(days: 10));
   recurrence.recurrenceRange = RecurrenceRange.endDate;
   appointments.add(
       Appointment(
         startTime: DateTime.now(),
         endTime: DateTime.now().add(
             Duration(hours: 2)),
         isAllDay: true,
         subject: 'Meeting',
         color: Colors.blue,
         startTimeZone: '',
         endTimeZone: '',
         recurrenceRule: SfCalendar.generateRRule(recurrence,
             DateTime.now(), DateTime.now().add(Duration(hours: 2)))
       ));

  return DataSource(appointments);
}

Implementation

DateTime? endDate;