MultipleScanningMode.fromJson constructor

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

Implementation

factory MultipleScanningMode.fromJson(Map<String, dynamic> json) =>
    MultipleScanningMode(
      countingRepeatDelay: json.containsKey("countingRepeatDelay")
          ? (json["countingRepeatDelay"] as int)
          : 1000,
      mode: json.containsKey("mode")
          ? MultipleBarcodesScanningMode.values.byName(json["mode"] as String)
          : MultipleBarcodesScanningMode.COUNTING,
      sheet: json.containsKey("sheet")
          ? Sheet.fromJson(json["sheet"] as Map<String, dynamic>)
          : Sheet(
              mode: SheetMode.COLLAPSED_SHEET,
              collapsedVisibleHeight: CollapsedVisibleHeight.SMALL,
              listButton: BadgedButton(
                  badgeBackgroundColor: ScanbotColor("?sbColorSurface"),
                  badgeForegroundColor: ScanbotColor("?sbColorPrimary"),
                  visible: true,
                  backgroundColor: ScanbotColor("?sbColorSurfaceHigh"),
                  foregroundColor: ScanbotColor("?sbColorOnPrimary"),
                  activeBackgroundColor: ScanbotColor("?sbColorSurfaceHigh"),
                  activeForegroundColor: ScanbotColor("?sbColorOnPrimary"))),
      sheetContent: json.containsKey("sheetContent")
          ? SheetContent.fromJson(
              json["sheetContent"] as Map<String, dynamic>)
          : SheetContent(
              sheetColor: ScanbotColor("?sbColorSurface"),
              dividerColor: ScanbotColor("?sbColorOutline"),
              manualCountChangeEnabled: true,
              manualCountOutlineColor: ScanbotColor("?sbColorOutline"),
              manualCountChangeColor: ScanbotColor("?sbColorPrimary"),
              title: StyledText(
                  text: "?multipleModeSheetTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              clearAllButton: ButtonConfiguration(
                  visible: true,
                  text: "?sheetClearAllButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnSurface"),
                      useShadow: false)),
              barcodeItemTitle: StyledText(
                  visible: true,
                  text: "BARCODE_TITLE",
                  color: ScanbotColor("?sbColorOnSurface"),
                  useShadow: false),
              barcodeItemSubtitle: StyledText(
                  visible: true,
                  text: "BARCODE_SUBTITLE",
                  color: ScanbotColor("?sbColorOnSurfaceVariant"),
                  useShadow: false),
              barcodeItemImageVisible: true,
              submitButton: ButtonConfiguration(
                  visible: true,
                  text: "?sheetSubmitButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnSurface"),
                      useShadow: false)),
              startScanningButton: ButtonConfiguration(
                  visible: true,
                  text: "?sheetStartScanningButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("?sbColorPrimary"),
                      fillColor: ScanbotColor("?sbColorPrimary"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnPrimary"),
                      useShadow: false)),
              placeholderTitle: StyledText(
                  visible: true,
                  text: "?sheetPlaceholderTitle",
                  color: ScanbotColor("?sbColorOnSurface"),
                  useShadow: false),
              placeholderSubtitle: StyledText(
                  visible: true,
                  text: "?sheetPlaceholderSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant"),
                  useShadow: false),
              placeholderIconBackground: ScanbotColor("?sbColorOutline"),
              placeholderIcon: IconStyle(
                  visible: true, color: ScanbotColor("?sbColorOnSurface")),
              swipeToDelete: SwipeToDelete(
                  enabled: true,
                  backgroundColor: ScanbotColor("?sbColorNegative"),
                  iconColor: ScanbotColor("?sbColorOnPrimary"))),
      manualCountEditDialog: json.containsKey("manualCountEditDialog")
          ? ManualCountEditDialog.fromJson(
              json["manualCountEditDialog"] as Map<String, dynamic>)
          : ManualCountEditDialog(
              sheetColor: ScanbotColor("?sbColorSurface"),
              dividerColor: ScanbotColor("?sbColorOutline"),
              modalOverlayColor: ScanbotColor("?sbColorModalOverlay"),
              title: StyledText(
                  text: "?manualCountEditDialogTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              info: StyledText(
                  text: "?manualCountEditDialogInfo",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              updateButton: ButtonConfiguration(
                  visible: true,
                  text: "?manualCountEditDialogUpdateButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("?sbColorPrimary"),
                      fillColor: ScanbotColor("?sbColorPrimary"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnPrimary"),
                      useShadow: false)),
              cancelButton: ButtonConfiguration(
                  visible: true,
                  text: "?manualCountEditDialogCancelButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorPrimary"),
                      useShadow: false)),
              clearTextButton: IconStyle(
                  visible: true,
                  color: ScanbotColor("?sbColorOnSurfaceVariant"))),
      barcodeInfoMapping: json.containsKey("barcodeInfoMapping")
          ? BarcodeInfoMapping.fromJson(
              json["barcodeInfoMapping"] as Map<String, dynamic>)
          : BarcodeInfoMapping(
              sheetColor: ScanbotColor("?sbColorSurface"),
              dividerColor: ScanbotColor("?sbColorOutline"),
              modalOverlayColor: ScanbotColor("?sbColorModalOverlay"),
              loadingMessage: StyledText(
                  text: "?barcodeInfoMappingLoadingMessage",
                  color: ScanbotColor("?sbColorPrimary")),
              errorState: BarcodeItemErrorState(
                  title: StyledText(
                      text: "?barcodeInfoMappingErrorStateTitle",
                      color: ScanbotColor("?sbColorOnSurface")),
                  subtitle: StyledText(
                      text: "?barcodeInfoMappingErrorStateSubtitle",
                      color: ScanbotColor("?sbColorOnSurfaceVariant")),
                  retryButton: ButtonConfiguration(
                      visible: true,
                      text: "?barcodeInfoMappingErrorStateRetryButton",
                      background: BackgroundStyle(
                          strokeColor: ScanbotColor("?sbColorPrimary"),
                          fillColor: ScanbotColor("?sbColorPrimary"),
                          strokeWidth: 1.0),
                      foreground: ForegroundStyle(
                          iconVisible: true,
                          color: ScanbotColor("?sbColorOnPrimary"),
                          useShadow: false)),
                  cancelButton: ButtonConfiguration(
                      visible: true,
                      text: "?barcodeInfoMappingErrorStateCancelButton",
                      background: BackgroundStyle(
                          strokeColor: ScanbotColor("#00000000"),
                          fillColor: ScanbotColor("#00000000"),
                          strokeWidth: 1.0),
                      foreground: ForegroundStyle(
                          iconVisible: false,
                          color: ScanbotColor("?sbColorPrimary"),
                          useShadow: false)))),
      arOverlay: json.containsKey("arOverlay")
          ? ArOverlayGeneralConfiguration.fromJson(
              json["arOverlay"] as Map<String, dynamic>)
          : ArOverlayGeneralConfiguration(
              visible: false,
              counterBadge: BadgeStyle(
                  visible: true,
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#FF000000"),
                      fillColor: ScanbotColor("?sbColorPositive"),
                      strokeWidth: 0.0),
                  foregroundColor: ScanbotColor("?sbColorOnSurface")),
              automaticSelectionEnabled: false,
              barcodeItemInfoPosition: BarcodeItemInfoPosition.BELOW,
              polygon: ArOverlayPolygonConfiguration(
                  visible: true,
                  deselected: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorSurface"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 3.0,
                      cornerRadius: 5.0),
                  selected: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorPositive"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 3.0,
                      cornerRadius: 5.0)),
              barcodeItemConfiguration: BarcodeItemConfiguration(
                  imageVisible: true,
                  titleSelected: StyledText(
                      text: "BARCODE_TITLE",
                      color: ScanbotColor("?sbColorOnSurface")),
                  subtitleSelected: StyledText(
                      visible: true,
                      text: "BARCODE_SUBTITLE",
                      color: ScanbotColor("?sbColorOnSurfaceVariant"),
                      useShadow: false),
                  titleDeselected: StyledText(
                      visible: true,
                      text: "BARCODE_TITLE",
                      color: ScanbotColor("?sbColorOnSurface"),
                      useShadow: false),
                  subtitleDeselected: StyledText(
                      text: "BARCODE_SUBTITLE",
                      color: ScanbotColor("?sbColorOnSurfaceVariant")),
                  backgroundSelected: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorPositive"),
                      fillColor: ScanbotColor("?sbColorPositive"),
                      strokeWidth: 1.0,
                      cornerRadius: 5.0),
                  backgroundDeselected: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorSurface"),
                      fillColor: ScanbotColor("?sbColorSurface"),
                      strokeWidth: 1.0,
                      cornerRadius: 5.0))),
    );