fromMap static method

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

Construct from Map.

Implementation

static EncryptedPassportElement? 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 type = PassportElementType.fromMap(_map['type'])!;
  var data = _map['data']! as bytes;
  var front_side = DatedFile.fromMap(_map['front_side'])!;
  var reverse_side = DatedFile.fromMap(_map['reverse_side']);
  var selfie = DatedFile.fromMap(_map['selfie']);
  var translation = List<DatedFile>.from(
    (_map["translation"] ?? []).map(
      (e) => DatedFile.fromMap(e),
    ),
  );
  var files = List<DatedFile>.from(
    (_map["files"] ?? []).map(
      (e) => DatedFile.fromMap(e),
    ),
  );
  var value = _map['value']! as String;
  var hash = _map['hash']! as String;
  return EncryptedPassportElement(
    extra: extra,
    clientId: clientId,
    type: type,
    data: data,
    front_side: front_side,
    reverse_side: reverse_side,
    selfie: selfie,
    translation: translation,
    files: files,
    value: value,
    hash: hash,
  );
}