Contact.fromMap constructor

Contact.fromMap(
  1. Map m
)

Implementation

Contact.fromMap(Map m) {
  identifier = m["identifier"];
  displayName = m["displayName"];
  givenName = m["givenName"];
  middleName = m["middleName"];
  familyName = m["familyName"];
  prefix = m["prefix"];
  suffix = m["suffix"];
  company = m["company"];
  jobTitle = m["jobTitle"];
  androidAccountTypeRaw = m["androidAccountType"];
  androidAccountType = accountTypeFromString(androidAccountTypeRaw);
  androidAccountName = m["androidAccountName"];
  emails = (m["emails"] as List?)?.map((m) => Item.fromMap(m)).toList();
  phones = (m["phones"] as List?)?.map((m) => Item.fromMap(m)).toList();
  postalAddresses = (m["postalAddresses"] as List?)
      ?.map((m) => PostalAddress.fromMap(m))
      .toList();
  avatar = m["avatar"];
  try {
    birthday = m["birthday"] != null ? DateTime.parse(m["birthday"]) : null;
  } catch (e) {
    birthday = null;
  }
}