# CommonBarcodeScannerConfiguration.fromJson constructor

CommonBarcodeScannerConfiguration.fromJson(

1. Map<String, dynamic> json

)

## Implementation

    factory CommonBarcodeScannerConfiguration.fromJson(
            Map<String, dynamic> json) =>
        CommonBarcodeScannerConfiguration(
          extractedDocumentFormats: json.containsKey("extractedDocumentFormats")
              ? (json["extractedDocumentFormats"] as List<dynamic>)
                  .map((it) => BarcodeDocumentFormat.values.byName(it as String))
                  .toList()
              : [
                  BarcodeDocumentFormat.AAMVA,
                  BarcodeDocumentFormat.BOARDING_PASS,
                  BarcodeDocumentFormat.DE_MEDICAL_PLAN,
                  BarcodeDocumentFormat.MEDICAL_CERTIFICATE,
                  BarcodeDocumentFormat.ID_CARD_PDF_417,
                  BarcodeDocumentFormat.SEPA,
                  BarcodeDocumentFormat.SWISS_QR,
                  BarcodeDocumentFormat.VCARD,
                  BarcodeDocumentFormat.GS1,
                  BarcodeDocumentFormat.HIBC
                ],
          onlyAcceptDocuments: json.containsKey("onlyAcceptDocuments")
              ? (json["onlyAcceptDocuments"] as bool)
              : false,
          extensions: json.containsKey("extensions")
              ? UpcEanExtensionBehavior.values
                  .byName(json["extensions"] as String)
              : UpcEanExtensionBehavior.ALLOW_ANY,
          barcodesRegexFilter: json.containsKey("barcodesRegexFilter")
              ? json["barcodesRegexFilter"] as String
              : "",
          minimumSizeScore: json.containsKey("minimumSizeScore")
              ? (json["minimumSizeScore"] as num).toDouble()
              : 0.0,
          minimumTextLength: json.containsKey("minimumTextLength")
              ? (json["minimumTextLength"] as int)
              : 0,
          maximumTextLength: json.containsKey("maximumTextLength")
              ? (json["maximumTextLength"] as int)
              : 0,
          minimum1DBarcodesQuietZone:
              json.containsKey("minimum1DBarcodesQuietZone")
                  ? (json["minimum1DBarcodesQuietZone"] as int)
                  : 10,
          stripCheckDigits: json.containsKey("stripCheckDigits")
              ? (json["stripCheckDigits"] as bool)
              : false,
          useIATA2OF5Checksum: json.containsKey("useIATA2OF5Checksum")
              ? (json["useIATA2OF5Checksum"] as bool)
              : true,
          useCode11Checksum: json.containsKey("useCode11Checksum")
              ? (json["useCode11Checksum"] as bool)
              : true,
          barcodeFormats: json.containsKey("barcodeFormats")
              ? (json["barcodeFormats"] as List<dynamic>)
                  .map((it) => BarcodeFormat.values.byName(it as String))
                  .toList()
              : [
                  BarcodeFormat.AZTEC,
                  BarcodeFormat.CODABAR,
                  BarcodeFormat.CODE_39,
                  BarcodeFormat.CODE_93,
                  BarcodeFormat.CODE_128,
                  BarcodeFormat.DATA_MATRIX,
                  BarcodeFormat.DATABAR,
                  BarcodeFormat.DATABAR_EXPANDED,
                  BarcodeFormat.DATABAR_LIMITED,
                  BarcodeFormat.EAN_13,
                  BarcodeFormat.EAN_8,
                  BarcodeFormat.ITF,
                  BarcodeFormat.MICRO_QR_CODE,
                  BarcodeFormat.PDF_417,
                  BarcodeFormat.QR_CODE,
                  BarcodeFormat.UPC_A,
                  BarcodeFormat.UPC_E
                ],
          msiPlesseyChecksumAlgorithm:
              json.containsKey("msiPlesseyChecksumAlgorithm")
                  ? MsiPlesseyChecksumAlgorithm.values
                      .byName(json["msiPlesseyChecksumAlgorithm"] as String)
                  : MsiPlesseyChecksumAlgorithm.MOD_10,
          australiaPostCustomerFormat:
              json.containsKey("australiaPostCustomerFormat")
                  ? AustraliaPostCustomerFormat.values
                      .byName(json["australiaPostCustomerFormat"] as String)
                  : AustraliaPostCustomerFormat.ALPHA_NUMERIC,
          lowPowerMode: json.containsKey("lowPowerMode")
              ? (json["lowPowerMode"] as bool)
              : false,
          gs1Handling: json.containsKey("gs1Handling")
              ? Gs1Handling.values.byName(json["gs1Handling"] as String)
              : Gs1Handling.PARSE,
          returnBarcodeImage: json.containsKey("returnBarcodeImage")
              ? (json["returnBarcodeImage"] as bool)
              : false,
        );