EncryptedPassportElement.fromJson constructor

EncryptedPassportElement.fromJson(
  1. Map<String, dynamic> json
)

Creates a new EncryptedPassportElement object from json.

Implementation

factory EncryptedPassportElement.fromJson(Map<String, dynamic> json) {
  return EncryptedPassportElement(
    type: PassportType.fromJson(json['type']!),
    data: json['data'],
    phoneNumber: json['phone_number'],
    email: json['email'],
    files: (json['files'] as List<dynamic>?)
        ?.map((e) => PassportFile.fromJson(e))
        .toList(),
    frontSide: json['front_side'] != null
        ? PassportFile.fromJson(json['front_side']!)
        : null,
    reverseSide: json['reverse_side'] != null
        ? PassportFile.fromJson(json['reverse_side']!)
        : null,
    selfie: json['selfie'] != null
        ? PassportFile.fromJson(json['selfie']!)
        : null,
    translation: (json['translation'] as List<dynamic>?)
        ?.map((e) => PassportFile.fromJson(e))
        .toList(),
    hash: json['hash']!,
  );
}