toJson method

Map<String, dynamic> toJson({
  1. bool withThumbnail = true,
  2. bool withPhoto = true,
})

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(),
    });