fromJson static method

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

Implementation

static InputIdentityDocument? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return InputIdentityDocument(
    number: (json['number'] as String?) ?? '',
    expirationDate: Date.fromJson(tdMapFromJson(json['expiration_date'])),
    frontSide: InputFile.fromJson(tdMapFromJson(json['front_side'])),
    reverseSide: InputFile.fromJson(tdMapFromJson(json['reverse_side'])),
    selfie: InputFile.fromJson(tdMapFromJson(json['selfie'])),
    translation: List<InputFile>.from(
      tdListFromJson(json['translation'])
          .map((item) => InputFile.fromJson(tdMapFromJson(item)))
          .whereType<InputFile>(),
    ),
  );
}