fromMap static method

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

Construct from Map.

Implementation

static PersonalDetails? 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 first_name = _map['first_name']! as String;
  var middle_name = _map['middle_name']! as String;
  var last_name = _map['last_name']! as String;
  var native_first_name = _map['native_first_name']! as String;
  var native_middle_name = _map['native_middle_name']! as String;
  var native_last_name = _map['native_last_name']! as String;
  var birthdate = Date.fromMap(_map['birthdate'])!;
  var gender = _map['gender']! as String;
  var country_code = _map['country_code']! as String;
  var residence_country_code = _map['residence_country_code']! as String;
  return PersonalDetails(
    extra: extra,
    clientId: clientId,
    first_name: first_name,
    middle_name: middle_name,
    last_name: last_name,
    native_first_name: native_first_name,
    native_middle_name: native_middle_name,
    native_last_name: native_last_name,
    birthdate: birthdate,
    gender: gender,
    country_code: country_code,
    residence_country_code: residence_country_code,
  );
}