Calendar.fromJson constructor
Creates a new instance of Calendar from a JSON object.
The JSON object should contain keys that correspond to the parameters of Calendar. The 'allowedOnlineMeetingProviders' key should map to a list of strings. The 'owner' key should map to a JSON object that can be converted to a CalendarOwner object.
Implementation
factory Calendar.fromJson(Map<String, dynamic> json) {
return Calendar(
id: json['id'],
name: json['name'],
color: json['color'],
isDefaultCalendar: json['isDefaultCalendar'],
changeKey: json['changeKey'],
canShare: json['canShare'],
canViewPrivateItems: json['canViewPrivateItems'],
hexColor: json['hexColor'],
canEdit: json['canEdit'],
allowedOnlineMeetingProviders:
json['allowedOnlineMeetingProviders'].cast<String>(),
defaultOnlineMeetingProvider: json['defaultOnlineMeetingProvider'],
isTallyingResponses: json['isTallyingResponses'],
isRemovable: json['isRemovable'],
owner: CalendarOwner.fromJson(json['owner']),
);
}