toJson method
Implementation
Map<String, dynamic> toJson({
bool withThumbnail = true,
bool withPhoto = true,
}) =>
Map<String, dynamic>.from({
'id': id,
'displayName': displayName,
'thumbnail': withThumbnail ? thumbnail : null,
'photo': withPhoto ? photo : null,
'isStarred': isStarred,
'name': name.toJson(),
'phones': phones.map((x) => x.toJson()).toList(),
'emails': emails.map((x) => x.toJson()).toList(),
'addresses': addresses.map((x) => x.toJson()).toList(),
'organizations': organizations.map((x) => x.toJson()).toList(),
'websites': websites.map((x) => x.toJson()).toList(),
'socialMedias': socialMedias.map((x) => x.toJson()).toList(),
'events': events.map((x) => x.toJson()).toList(),
'notes': notes.map((x) => x.toJson()).toList(),
'accounts': accounts.map((x) => x.toJson()).toList(),
'groups': groups.map((x) => x.toJson()).toList(),
});