updateEvent method

Future<String> updateEvent ({String calendarId, CalendarEvent event })

Helps to update the edited event

Implementation

Future<String> updateEvent({String calendarId, CalendarEvent event}) async {
  String eventId;

  try {
    eventId = await _channel.invokeMethod(
      'updateEvent',
      <String, Object>{
        "calendarId": calendarId,
        'eventId': event.eventId != null ? event.eventId : null,
        'title': event.title,
        'description': event.description,
        'startDate': event.startDate.millisecondsSinceEpoch,
        'endDate': event.endDate.millisecondsSinceEpoch,
        'location': event.location,
        'isAllDay': event.isAllDay != null ? event.isAllDay : false,
        'hasAlarm': event.hasAlarm != null ? event.hasAlarm : false,
        'reminder': event.reminder != null ? event.reminder.minutes : null,
      },
    );
  } catch (e) {
    print(e);
  }
  return eventId;
}