toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  Map<String, dynamic> params = {
    'title': title,
    'desc': description,
    'location': location,
    'startDate': startDate.millisecondsSinceEpoch,
    'endDate': endDate.millisecondsSinceEpoch,
    'timeZone': timeZone,
    'allDay': allDay,
    'recurrence': recurrence?.toJson(),
  };

  if (Platform.isIOS) {
    params['alarmInterval'] = iosParams.reminder?.inSeconds.toDouble();
    params['url'] = iosParams.url;
  } else {
    params['invites'] = androidParams.emailInvites?.join(",");
  }

  return params;
}