deleteEventInstance method

  1. @override
Future<bool> deleteEventInstance(
  1. String calendarId,
  2. String eventId,
  3. DateTime startDate, {
  4. bool followingInstances = false,
})
override

Delete a specific instance of a recurring event

calendarId - The ID of the calendar eventId - The ID of the event startDate - The start date of the specific instance to delete followingInstances - Whether to delete following instances as well

Returns true if the event instance was successfully deleted Throws PermissionDeniedException if permissions are not granted Throws EventNotFoundException if the event doesn't exist

Implementation

@override
Future<bool> deleteEventInstance(
  String calendarId,
  String eventId,
  DateTime startDate, {
  bool followingInstances = false,
}) async {
  try {
    final result = await _methodChannel.invokeMethod<bool>(
      'deleteEventInstance',
      {
        'calendarId': calendarId,
        'eventId': eventId,
        'startDate': startDate.millisecondsSinceEpoch,
        'followingInstances': followingInstances,
      },
    );

    return result ?? false;
  } on PlatformException catch (e) {
    throw _mapPlatformException(e);
  }
}