id property

Object? id
getter/setter pair

Defines the id for an Appointment in SfCalendar.

The unique identifier for the appointment. It must be mentioned to add an exception appointment to the recurrence series.

Defaults to the hash code of the appointment. id can be set to all the appointment types where the internally created occurrence appointment will have the same id value as the pattern appointment.

The exception appointment should have the different id value compared to the pattern appointment. But the recurrenceId of the exception appointment and the id value of the pattern appointment should be same.

See also:

  • CalendarDataSource.id, which maps the custom business objects corresponding property to this property.
  • recurrenceId, which used to create an exception/changed occurrence appointment.
  • appointmentType, which used to identify the different appointment types.

AppointmentDataSource _getDataSource() {
    List<Appointment> appointments = <Appointment>[];

    appointments.add(Appointment(
      startTime: DateTime(2021, 04, 12, 10),
      endTime: DateTime(2021, 04, 12, 12),
      subject: 'Scrum meeting',
      id: '01',
      recurrenceRule: 'FREQ=DAILY;INTERVAL=1;COUNT=10',
    ));
    appointments.add(Appointment(
      startTime: DateTime(2021, 04, 12, 16),
      endTime: DateTime(2021, 04, 12, 17),
      subject: 'Meeting',
      id: '02',
    ));
    appointments.add(Appointment(
      startTime: DateTime(2021, 04, 13, 09),
      endTime: DateTime(2021, 04, 13, 10),
      subject: 'Discussion',
    ));

    return AppointmentDataSource(appointments);
  }

Implementation

Object? id;