EncryptedPassportElement.fromJson constructor

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

Parse from a json

Implementation

factory EncryptedPassportElement.fromJson(Map<String, dynamic> json) =>
    EncryptedPassportElement(
      type: PassportElementType.fromJson(json['type']),
      data: json['data'],
      frontSide: DatedFile.fromJson(json['front_side']),
      reverseSide: json['reverse_side'] == null
          ? null
          : DatedFile.fromJson(json['reverse_side']),
      selfie:
          json['selfie'] == null ? null : DatedFile.fromJson(json['selfie']),
      translation: List<DatedFile>.from((json['translation'] ?? [])
          .map((item) => DatedFile.fromJson(item))
          .toList()),
      files: List<DatedFile>.from((json['files'] ?? [])
          .map((item) => DatedFile.fromJson(item))
          .toList()),
      value: json['value'],
      hash: json['hash'],
    );