IntroductionScreenConfiguration.fromJson constructor

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

Implementation

factory IntroductionScreenConfiguration.fromJson(Map<String, dynamic> json) =>
    IntroductionScreenConfiguration(
      backgroundColor: json.containsKey("backgroundColor")
          ? ScanbotColor(json["backgroundColor"] as String)
          : ScanbotColor("?sbColorSurface"),
      dividerColor: json.containsKey("dividerColor")
          ? ScanbotColor(json["dividerColor"] as String)
          : ScanbotColor("?sbColorOutline"),
      handlerColor: json.containsKey("handlerColor")
          ? ScanbotColor(json["handlerColor"] as String)
          : ScanbotColor("?sbColorOutline"),
      showAutomatically: json.containsKey("showAutomatically")
          ? (json["showAutomatically"] as bool)
          : false,
      topBarDoneButton: json.containsKey("topBarDoneButton")
          ? ButtonConfiguration.fromJson(
              json["topBarDoneButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: true,
              text: "?cameraIntroDoneButton",
              accessibilityDescription:
                  "?accessibilityDescriptionCameraIntroDoneButton",
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("#00000000"),
                  fillColor: ScanbotColor("#00000000"),
                  strokeWidth: 0.0),
              foreground: ForegroundStyle(
                  iconVisible: true,
                  color: ScanbotColor("?sbColorPrimary"),
                  useShadow: false)),
      title: json.containsKey("title")
          ? StyledText.fromJson(json["title"] as Map<String, dynamic>)
          : StyledText(
              text: "?cameraIntroTitle",
              color: ScanbotColor("?sbColorOnSurface")),
      subtitle: json.containsKey("subtitle")
          ? StyledText.fromJson(json["subtitle"] as Map<String, dynamic>)
          : StyledText(
              text: "?cameraIntroSubtitle",
              color: ScanbotColor("?sbColorOnSurface")),
      items: json.containsKey("items")
          ? (json["items"] as List<dynamic>)
              .map(
                  (it) => IntroListEntry.fromJson(it as Map<String, dynamic>))
              .toList()
          : [
              IntroListEntry(
                  image: DocumentIntroImage(),
                  text: StyledText(
                      text: "?cameraIntroItem1",
                      color: ScanbotColor("?sbColorOnSurface"))),
              IntroListEntry(
                  image: NoIntroImage(),
                  text: StyledText(
                      text: "?cameraIntroItem2",
                      color: ScanbotColor("?sbColorOnSurface"))),
              IntroListEntry(
                  image: NoIntroImage(),
                  text: StyledText(
                      text: "?cameraIntroItem3",
                      color: ScanbotColor("?sbColorOnSurface"))),
              IntroListEntry(
                  image: NoIntroImage(),
                  text: StyledText(
                      text: "?cameraIntroItem4",
                      color: ScanbotColor("?sbColorOnSurface")))
            ],
    );