month property

int month
getter/setter pair

Defines the month of the appointment when recurrence type as year.

Defines the month for an Appointment to recur.

The Appointment will recur on the month set to this property on specific year, when the recurrenceType set as RecurrenceType.year.

See also:

  • recurrenceType, which used to define the the type of 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.yearly;
   recurrence.dayOfMonth = 15;
   recurrence.month = 12;
   recurrence.interval = 1;
  recurrence.recurrenceRange = RecurrenceRange.noEndDate;
   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 month;