CalendarEvent.fromJson constructor
CalendarEvent.fromJson(
- Map<String, dynamic> data
)
Implementation
CalendarEvent.fromJson(Map<String, dynamic> data) {
this.eventId = data['eventId'];
this.title = data['title'];
this.description = data['description'];
var date = data['startDate'];
if (date != null) {
this.startDate = DateTime.fromMillisecondsSinceEpoch(date);
}
date = data['endDate'];
if (date != null) {
this.endDate = DateTime.fromMillisecondsSinceEpoch(date);
}
this.location = data['location'];
this.isAllDay = data['isAllDay'];
this.hasAlarm = data['hasAlarm'];
this.url = data['url'];
if (data['reminder'] != null) {
this.reminder = Reminder.fromJson(data['reminder']);
}
if (data['attendees'] != null && (data['attendees'] as List).isNotEmpty) {
this.attendees = Attendees.fromJson(data['attendees']);
}
}