BarcodeFormatFourStateConfigurationBase.fromJson constructor

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

Implementation

factory BarcodeFormatFourStateConfigurationBase.fromJson(
    Map<String, dynamic> json) {
  String _type = json["_type"];
  switch (_type) {
    case "BarcodeFormatAustraliaPostConfiguration":
      return BarcodeFormatAustraliaPostConfiguration.fromJson(json);
    case "BarcodeFormatJapanPostConfiguration":
      return BarcodeFormatJapanPostConfiguration.fromJson(json);
    case "BarcodeFormatRoyalMailConfiguration":
      return BarcodeFormatRoyalMailConfiguration.fromJson(json);
    case "BarcodeFormatRoyalTNTPostConfiguration":
      return BarcodeFormatRoyalTntPostConfiguration.fromJson(json);
    case "BarcodeFormatUSPSIntelligentMailConfiguration":
      return BarcodeFormatUspsIntelligentMailConfiguration.fromJson(json);
    case "BarcodeFormatPharmaCodeTwoTrackConfiguration":
      return BarcodeFormatPharmaCodeTwoTrackConfiguration.fromJson(json);
    default:
      throw ArgumentError("Invalid polymorphic type: $_type");
  }
}