Contact.fromJson constructor

Contact.fromJson(
  1. Map<String, dynamic> json
)

Creates a new instance of Contact from a JSON object.

Implementation

factory Contact.fromJson(Map<String, dynamic> json) {
  return Contact(
    assistantName: json['assistantName'],
    birthday: DateTime.tryParse(json['birthday'] ?? ''),
    businessAddress: json['businessAddress'] != null
        ? Address.fromJson(json['businessAddress'])
        : null,
    businessHomePage: json['businessHomePage'],
    businessPhones: toListStr(json['businessPhones']),
    categories: toListStr(json['categories']),
    changeKey: json['changeKey'],
    children: toListStr(json['children']),
    companyName: json['companyName'],
    createdDateTime: DateTime.tryParse(json['createdDateTime']),
    department: json['department'],
    displayName: json['displayName'],
    emailAddresses: json['emailAddresses'] == null
        ? null
        : (json['emailAddresses'] as List<dynamic>)
            .map((e) => EmailAddress.fromJson(e))
            .toList(),
    fileAs: json['fileAs'],
    generation: json['generation'],
    givenName: json['givenName'],
    homeAddress:
        json['homeAddress'] != null ? Address.fromJson(json['homeAddress']) : null,
    homePhones: toListStr(json['homePhones']),
    id: json['id'],
    imAddresses: toListStr(json['imAddresses']),
    initials: json['initials'],
    jobTitle: json['jobTitle'],
    lastModifiedDateTime: DateTime.tryParse(json['lastModifiedDateTime']),
    manager: json['manager'],
    middleName: json['middleName'],
    mobilePhone: json['mobilePhone'],
    nickName: json['nickName'],
    officeLocation: json['officeLocation'],
    otherAddress:
        json['otherAddress'] != null ? Address.fromJson(json['otherAddress']) : null,
    parentFolderId: json['parentFolderId'],
    personalNotes: json['personalNotes'],
    profession: json['profession'],
    spouseName: json['spouseName'],
    surname: json['surname'],
    title: json['title'],
    yomiCompanyName: json['yomiCompanyName'],
    yomiGivenName: json['yomiGivenName'],
    yomiSurname: json['yomiSurname'],
  );
}