RecipientModel.fromJson constructor
RecipientModel.fromJson(
- Map<String, dynamic> json
)
Implementation
factory RecipientModel.fromJson(Map<String, dynamic> json) {
return RecipientModel(
json['id'],
json['version'],
json['number'],
json['subject'],
json['value'] is int ? json['value'].toDouble() : json['value'],
json['currencyCode'],
json['fyi'],
json['model'],
json['formId'],
List.from(json.containsKey('actions')
? (json['actions'] as List).map((e) => e as String).toList()
: []),
List<Sibling>.from(json['recipients'].map((e) => Sibling.fromJson(e))),
List<Comment>.from(json['comments'].map((e) => Comment.fromJson(e))),
List<Entry>.from(json['cubes'].map((e) => Entry.fromJson(e))),
List<Attachment>.from(
json['attachments'].map((e) => Attachment.fromJson(e))),
//json.containsKey('viewed') ? DateTime.parse(json['viewed']) : null,
null,
json['unreadComments'],
json['documentId'],
json['folderId'],
json['flag'],
DateTime.parse(json['received']),
json['read'],
json['draft'],
json['pending'],
json['escalated'],
json['summary'],
json['extra'],
);
}