FindAndPickScanningMode.fromJson constructor

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

Implementation

factory FindAndPickScanningMode.fromJson(Map<String, dynamic> json) =>
    FindAndPickScanningMode(
      scanningCompletedColor: json.containsKey("scanningCompletedColor")
          ? ScanbotColor(json["scanningCompletedColor"] as String)
          : ScanbotColor("?sbColorPositive"),
      scanningPartiallyColor: json.containsKey("scanningPartiallyColor")
          ? ScanbotColor(json["scanningPartiallyColor"] as String)
          : ScanbotColor("?sbColorWarning"),
      scanningNotScannedColor: json.containsKey("scanningNotScannedColor")
          ? ScanbotColor(json["scanningNotScannedColor"] as String)
          : ScanbotColor("?sbColorOutline"),
      allowPartialScan: json.containsKey("allowPartialScan")
          ? (json["allowPartialScan"] as bool)
          : false,
      expectedBarcodes: json.containsKey("expectedBarcodes")
          ? (json["expectedBarcodes"] as List<dynamic>)
              .map((it) =>
                  ExpectedBarcode.fromJson(it as Map<String, dynamic>))
              .toList()
          : [],
      countingRepeatDelay: json.containsKey("countingRepeatDelay")
          ? (json["countingRepeatDelay"] as int)
          : 1000,
      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(
                  visible: true,
                  text: "?findAndPickSheetTitle",
                  color: ScanbotColor("?sbColorOnSurface"),
                  useShadow: false),
              clearAllButton: ButtonConfiguration(
                  visible: true,
                  text: "?sheetResetButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnSurface"),
                      useShadow: false)),
              barcodeItemTitle: StyledText(
                  text: "BARCODE_TITLE",
                  color: ScanbotColor("?sbColorOnSurface")),
              barcodeItemSubtitle: StyledText(
                  text: "?findAndPickSheetBarcodeItemSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              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(
                  text: "?sheetPlaceholderTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              placeholderSubtitle: StyledText(
                  text: "?sheetPlaceholderSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              placeholderIconBackground: ScanbotColor("?sbColorOutline"),
              placeholderIcon: IconStyle(
                  visible: true, color: ScanbotColor("?sbColorOnSurface")),
              swipeToDelete: SwipeToDelete(
                  enabled: false,
                  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"))),
      arOverlay: json.containsKey("arOverlay")
          ? ArOverlayFindAndPickConfiguration.fromJson(
              json["arOverlay"] as Map<String, dynamic>)
          : ArOverlayFindAndPickConfiguration(
              visible: false,
              automaticSelectionEnabled: true,
              polygon: FindAndPickArOverlayPolygonConfiguration(
                  partiallyScanned: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorWarning"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 3.0,
                      cornerRadius: 5.0),
                  rejected: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorSurface"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 3.0,
                      cornerRadius: 5.0),
                  completed: PolygonStyle(
                      strokeColor: ScanbotColor("?sbColorPositive"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 3.0,
                      cornerRadius: 5.0)),
              badge: FindAndPickBadgeConfiguration(
                  partiallyScanned: BadgeStyle(
                      visible: true,
                      background: BackgroundStyle(
                          strokeColor: ScanbotColor("#000000FF"),
                          fillColor: ScanbotColor("?sbColorWarning"),
                          strokeWidth: 0.0),
                      foregroundColor: ScanbotColor("?sbColorOnSurface")),
                  rejected: BadgeStyle(
                      visible: true,
                      background: BackgroundStyle(
                          strokeColor: ScanbotColor("#000000FF"),
                          fillColor: ScanbotColor("?sbColorSurface"),
                          strokeWidth: 0.0),
                      foregroundColor: ScanbotColor("?sbColorOnSurface")),
                  completed: BadgeStyle(
                      visible: true,
                      background: BackgroundStyle(
                          strokeColor: ScanbotColor("#000000FF"),
                          fillColor: ScanbotColor("?sbColorPositive"),
                          strokeWidth: 0.0),
                      foregroundColor: ScanbotColor("?sbColorOnSurface")))),
      partialScannedAlertDialogEnabled:
          json.containsKey("partialScannedAlertDialogEnabled")
              ? (json["partialScannedAlertDialogEnabled"] as bool)
              : true,
      partialScannedAlertDialog: json.containsKey("partialScannedAlertDialog")
          ? ScanbotAlertDialog.fromJson(
              json["partialScannedAlertDialog"] as Map<String, dynamic>)
          : ScanbotAlertDialog(
              title: StyledText(
                  text: "?findAndPickPartialAlertTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              subtitle: StyledText(
                  text: "?findAndPickPartialAlertSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              sheetColor: ScanbotColor("?sbColorSurface"),
              modalOverlayColor: ScanbotColor("?sbColorModalOverlay"),
              dividerColor: ScanbotColor("?sbColorOutline"),
              okButton: ButtonConfiguration(
                  visible: true,
                  text: "?findAndPickPartialAlertSubmitButton",
                  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: "?findAndPickPartialAlertCancelButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorPrimary"),
                      useShadow: false))),
      confirmationAlertDialogEnabled:
          json.containsKey("confirmationAlertDialogEnabled")
              ? (json["confirmationAlertDialogEnabled"] as bool)
              : false,
      confirmationAlertDialog: json.containsKey("confirmationAlertDialog")
          ? ScanbotAlertDialog.fromJson(
              json["confirmationAlertDialog"] as Map<String, dynamic>)
          : ScanbotAlertDialog(
              title: StyledText(
                  text: "?findAndPickCompleteAlertTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              subtitle: StyledText(
                  text: "?findAndPickCompleteAlertSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              sheetColor: ScanbotColor("?sbColorSurface"),
              modalOverlayColor: ScanbotColor("?sbColorModalOverlay"),
              dividerColor: ScanbotColor("?sbColorOutline"),
              okButton: ButtonConfiguration(
                  visible: true,
                  text: "?findAndPickCompleteAlertSubmitButton",
                  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: "?findAndPickCompleteAlertCancelButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 1.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorPrimary"),
                      useShadow: false))),
    );