BarcodeRecognizerConfiguration.fromJson constructor

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

Implementation

factory BarcodeRecognizerConfiguration.fromJson(Map<String, dynamic> json) =>
    BarcodeRecognizerConfiguration(
      acceptedDocumentFormats: json.containsKey("acceptedDocumentFormats")
          ? (json["acceptedDocumentFormats"] as List<dynamic>)
              .map((it) => BarcodeDocumentFormat.values.byName(it as String))
              .toList()
          : [],
      barcodesExtensionFilter: json.containsKey("barcodesExtensionFilter")
          ? BarcodesExtensionFilter.values
              .byName(json["barcodesExtensionFilter"] as String)
          : BarcodesExtensionFilter.NO_FILTER,
      barcodesRegexFilter: json.containsKey("barcodesRegexFilter")
          ? json["barcodesRegexFilter"] as String
          : "",
      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,
      barcodeFormats: json.containsKey("barcodeFormats")
          ? (json["barcodeFormats"] as List<dynamic>)
              .map((it) => BarcodeFormat.values.byName(it as String))
              .toList()
          : [],
      msiPlesseyChecksumAlgorithm:
          json.containsKey("msiPlesseyChecksumAlgorithm")
              ? MSIPlesseyChecksumAlgorithm.values
                  .byName(json["msiPlesseyChecksumAlgorithm"] as String)
              : MSIPlesseyChecksumAlgorithm.MOD_10,
      lowPowerMode: json.containsKey("lowPowerMode")
          ? (json["lowPowerMode"] as bool)
          : false,
      codeDensity: json.containsKey("codeDensity")
          ? CodeDensity.values.byName(json["codeDensity"] as String)
          : CodeDensity.LOW,
      gs1Handling: json.containsKey("gs1Handling")
          ? Gs1Handling.values.byName(json["gs1Handling"] as String)
          : Gs1Handling.PARSE,
    );