CameraScreenConfiguration.fromJson constructor

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

Implementation

factory CameraScreenConfiguration.fromJson(Map<String, dynamic> json) =>
    CameraScreenConfiguration(
      acknowledgement: json.containsKey("acknowledgement")
          ? AcknowledgementScreenConfiguration.fromJson(
              json["acknowledgement"] as Map<String, dynamic>)
          : AcknowledgementScreenConfiguration(),
      introduction: json.containsKey("introduction")
          ? IntroductionScreenConfiguration.fromJson(
              json["introduction"] as Map<String, dynamic>)
          : IntroductionScreenConfiguration(),
      scanAssistanceOverlay: json.containsKey("scanAssistanceOverlay")
          ? ScanAssistanceOverlay.fromJson(
              json["scanAssistanceOverlay"] as Map<String, dynamic>)
          : ScanAssistanceOverlay(),
      cameraPermission: json.containsKey("cameraPermission")
          ? CameraPermissionScreen.fromJson(
              json["cameraPermission"] as Map<String, dynamic>)
          : CameraPermissionScreen(
              statusBarMode: StatusBarMode.DARK,
              background: ScanbotColor("?sbColorSurface"),
              iconBackground: ScanbotColor("?sbColorOutline"),
              icon: IconStyle(
                  visible: true, color: ScanbotColor("?sbColorOnSurface")),
              enableCameraButton: ButtonConfiguration(
                  visible: true,
                  text: "?cameraPermissionEnableCameraButton",
                  accessibilityDescription:
                      "?accessibilityDescriptionCameraPermissionEnableCameraButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("?sbColorPrimary"),
                      fillColor: ScanbotColor("?sbColorPrimary"),
                      strokeWidth: 0.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorOnPrimary"),
                      useShadow: false)),
              closeButton: ButtonConfiguration(
                  visible: true,
                  text: "?cameraPermissionCloseButton",
                  accessibilityDescription:
                      "?accessibilityDescriptionCameraPermissionCloseButton",
                  background: BackgroundStyle(
                      strokeColor: ScanbotColor("#00000000"),
                      fillColor: ScanbotColor("#00000000"),
                      strokeWidth: 0.0),
                  foreground: ForegroundStyle(
                      iconVisible: false,
                      color: ScanbotColor("?sbColorPrimary"),
                      useShadow: false)),
              enableCameraTitle: StyledText(
                  text: "?cameraPermissionEnableCameraTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              enableCameraExplanation: StyledText(
                  text: "?cameraPermissionEnableCameraExplanation",
                  color: ScanbotColor("?sbColorOnSurfaceVariant"))),
      topBarTitle: json.containsKey("topBarTitle")
          ? StyledText.fromJson(json["topBarTitle"] as Map<String, dynamic>)
          : StyledText(
              text: "?cameraTopBarTitle",
              color: ScanbotColor("?sbColorOnPrimary")),
      topBarIntroButton: json.containsKey("topBarIntroButton")
          ? IconButton.fromJson(
              json["topBarIntroButton"] as Map<String, dynamic>)
          : IconButton(
              color: ScanbotColor("?sbColorOnPrimary"),
              accessibilityDescription:
                  "?accessibilityDescriptionCameraTopBarIntroButton"),
      topBarBackButton: json.containsKey("topBarBackButton")
          ? ButtonConfiguration.fromJson(
              json["topBarBackButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: true,
              text: "?cameraTopBarCancelButtonTitle",
              accessibilityDescription:
                  "?accessibilityDescriptionCameraTopBarCancelButton",
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("#00000000"),
                  fillColor: ScanbotColor("#00000000"),
                  strokeWidth: 0.0),
              foreground: ForegroundStyle(
                  iconVisible: true,
                  color: ScanbotColor("?sbColorOnPrimary"),
                  useShadow: false)),
      topUserGuidance: json.containsKey("topUserGuidance")
          ? UserGuidanceConfiguration.fromJson(
              json["topUserGuidance"] as Map<String, dynamic>)
          : UserGuidanceConfiguration(
              title: StyledText(
                  text: "?cameraTopGuidance",
                  color: ScanbotColor("?sbColorOnPrimary"))),
      userGuidance: json.containsKey("userGuidance")
          ? DocumentScannerUserGuidance.fromJson(
              json["userGuidance"] as Map<String, dynamic>)
          : DocumentScannerUserGuidance(),
      backgroundColor: json.containsKey("backgroundColor")
          ? ScanbotColor(json["backgroundColor"] as String)
          : ScanbotColor("#000000FF"),
      cameraConfiguration: json.containsKey("cameraConfiguration")
          ? DocumentScannerCameraConfiguration.fromJson(
              json["cameraConfiguration"] as Map<String, dynamic>)
          : DocumentScannerCameraConfiguration(),
      polygon: json.containsKey("polygon")
          ? DocumentPolygonConfiguration.fromJson(
              json["polygon"] as Map<String, dynamic>)
          : DocumentPolygonConfiguration(),
      bottomBar: json.containsKey("bottomBar")
          ? CameraBottomBar.fromJson(
              json["bottomBar"] as Map<String, dynamic>)
          : CameraBottomBar(),
      viewFinder: json.containsKey("viewFinder")
          ? ViewFinderConfiguration.fromJson(
              json["viewFinder"] as Map<String, dynamic>)
          : ViewFinderConfiguration(
              visible: false,
              aspectRatio: AspectRatio(width: 21.0, height: 29.0)),
      captureFeedback: json.containsKey("captureFeedback")
          ? CaptureFeedback.fromJson(
              json["captureFeedback"] as Map<String, dynamic>)
          : CaptureFeedback(),
      vibration: json.containsKey("vibration")
          ? Vibration.fromJson(json["vibration"] as Map<String, dynamic>)
          : Vibration(enabled: true),
      timeouts: json.containsKey("timeouts")
          ? Timeouts.fromJson(json["timeouts"] as Map<String, dynamic>)
          : Timeouts(autoCancelTimeout: 0, initialScanDelay: 0),
      limitReachedAlertDialog: json.containsKey("limitReachedAlertDialog")
          ? ScanbotAlertDialog.fromJson(
              json["limitReachedAlertDialog"] as Map<String, dynamic>)
          : ScanbotAlertDialog(
              title: StyledText(
                  text: "?cameraLimitReachedAlertTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              subtitle: StyledText(
                  text: "?cameraLimitReachedAlertSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              okButton: ButtonConfiguration(
                  text: "?cameraLimitReachedOkButtonTitle",
                  accessibilityDescription:
                      "?accessibilityDescriptionCameraLimitReachedOkButton",
                  background: BackgroundStyle(
                      fillColor: ScanbotColor("?sbColorPrimary"),
                      strokeWidth: 0.0),
                  foreground: ForegroundStyle(
                      color: ScanbotColor("?sbColorOnPrimary"))),
              cancelButton: ButtonConfiguration(visible: false)),
      cancelAlertDialog: json.containsKey("cancelAlertDialog")
          ? ScanbotAlertDialog.fromJson(
              json["cancelAlertDialog"] as Map<String, dynamic>)
          : ScanbotAlertDialog(
              title: StyledText(
                  text: "?cameraCancelAlertTitle",
                  color: ScanbotColor("?sbColorOnSurface")),
              subtitle: StyledText(
                  text: "?cameraCancelAlertSubtitle",
                  color: ScanbotColor("?sbColorOnSurfaceVariant")),
              okButton: ButtonConfiguration(
                  text: "?cameraCancelYesButtonTitle",
                  accessibilityDescription:
                      "?accessibilityDescriptionCameraCancelYesButton",
                  background: BackgroundStyle(
                      fillColor: ScanbotColor("?sbColorPrimary"),
                      strokeWidth: 0.0),
                  foreground: ForegroundStyle(
                      color: ScanbotColor("?sbColorOnPrimary"))),
              cancelButton: ButtonConfiguration(
                  text: "?cameraCancelNoButtonTitle",
                  accessibilityDescription:
                      "?accessibilityDescriptionCameraCancelNoButton",
                  background: BackgroundStyle(
                      fillColor: ScanbotColor("#00000000"), strokeWidth: 0.0),
                  foreground: ForegroundStyle(
                      color: ScanbotColor("?sbColorPrimary")))),
    );