getCalendar<T> method

Future<PersistentCalendarInstance<T>> getCalendar<T>({
  1. required String name,
  2. required PCEventBuilder<T> builder,
  3. required PCIdSelector<T> idSelector,
  4. DeviceCalendarEventStore? store,
})

Instantiates a PersistentCalendarInstance for the specified generic type T. This will automatically create or get the device calendar identified by name.

Native events will be mapped to their foreign id provided by idSelector with the mapping being stored in store. Events will be constructed via builder.

Implementation

Future<PersistentCalendarInstance<T>> getCalendar<T>({
  required String name,
  required PCEventBuilder<T> builder,
  required PCIdSelector<T> idSelector,
  DeviceCalendarEventStore? store
}) async {
  var calendar = await getOrCreateCalendar(name);
  return PersistentCalendarInstance(this, builder, idSelector, calendar, store ?? SharedPreferencesDeviceCalendarStore());
}