fromMap static method

Contact? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static Contact? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var phone_number = _map['phone_number']! as String;
  var first_name = _map['first_name']! as String;
  var last_name = _map['last_name']! as String;
  var vcard = _map['vcard']! as String;
  var user_id = _map['user_id']! as int;
  return Contact(
    extra: extra,
    clientId: clientId,
    phone_number: phone_number,
    first_name: first_name,
    last_name: last_name,
    vcard: vcard,
    user_id: user_id,
  );
}