IntroImage.fromJson constructor

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

Implementation

factory IntroImage.fromJson(Map<String, dynamic> json) {
  String _type = json["_type"];
  switch (_type) {
    case "NoIntroImage":
      return NoIntroImage.fromJson(json);
    case "ReceiptsIntroImage":
      return ReceiptsIntroImage.fromJson(json);
    case "MedicalCertificateIntroImage":
      return MedicalCertificateIntroImage.fromJson(json);
    case "DocumentIntroImage":
      return DocumentIntroImage.fromJson(json);
    case "CheckIntroImage":
      return CheckIntroImage.fromJson(json);
    case "IdCardIntroImage":
      return IdCardIntroImage.fromJson(json);
    case "CreditCardIntroImage":
      return CreditCardIntroImage.fromJson(json);
    case "CustomImage":
      return CustomImage.fromJson(json);
    default:
      throw ArgumentError("Invalid polymorphic type: $_type");
  }
}