deleteEvent method

Future<Result<bool>> deleteEvent(
  1. String? calendarId,
  2. String? eventId
)

Deletes an event from a calendar. For a recurring event, this will delete all instances of it.
To delete individual instance of a recurring event, please use deleteEventInstance()

The calendarId parameter is the id of the calendar that plugin will try to delete the event from
The eventId parameter is the id of the event that plugin will try to delete

Returns a Result indicating if the event has (true) or has not (false) been deleted from the calendar

Implementation

Future<Result<bool>> deleteEvent(
  String? calendarId,
  String? eventId,
) async {
  return _invokeChannelMethod(
    ChannelConstants.methodNameDeleteEvent,
    assertParameters: (result) {
      _validateCalendarIdParameter(
        result,
        calendarId,
      );

      _assertParameter(
        result,
        eventId?.isNotEmpty ?? false,
        ErrorCodes.invalidArguments,
        ErrorMessages.deleteEventInvalidArgumentsMessage,
      );
    },
    arguments: () => <String, Object?>{
      ChannelConstants.parameterNameCalendarId: calendarId,
      ChannelConstants.parameterNameEventId: eventId,
    },
  );
}