Contact.fromJson constructor

Contact.fromJson(
  1. String address,
  2. Map? data
)

Implementation

Contact.fromJson(String address, Map? data) {
  _address = address;
  if (data == null) return;
  if (data.containsKey("first")) {
    _firstName = data["first"];
  }
  if (data.containsKey("last")) {
    _lastName = data["last"];
  }
  if (data.containsKey("name")) {
    _fullName = data["name"];
  }
  if (data.containsKey("photo")) {
    _photo = Photo(Uri.parse(data["photo"]), isFullSize: true);
  }
  if (data.containsKey("thumbnail")) {
    _thumbnail = Photo(Uri.parse(data["thumbnail"]));
  }
}