recurrenceCount property
Defines the recurrence count of an Appointment.
When the recurrence Range
is set to Recurrences Range.count
,
the Appointment will recur to specific count based on the value set
for this property.
Defaults to 1
.
Note: It is applicable only when the recurrenceRange set as RecurrenceRange.count.
See also:
- recurrenceRange, to define the range for the recurring event.
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.count;
recurrence.recurrenceCount = 10;
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
int recurrenceCount;