ManualCountEditDialog.fromJson constructor

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

Implementation

factory ManualCountEditDialog.fromJson(Map<String, dynamic> json) =>
    ManualCountEditDialog(
      sheetColor: json.containsKey("sheetColor")
          ? ScanbotColor(json["sheetColor"] as String)
          : ScanbotColor("?sbColorSurface"),
      dividerColor: json.containsKey("dividerColor")
          ? ScanbotColor(json["dividerColor"] as String)
          : ScanbotColor("?sbColorOutline"),
      modalOverlayColor: json.containsKey("modalOverlayColor")
          ? ScanbotColor(json["modalOverlayColor"] as String)
          : ScanbotColor("?sbColorModalOverlay"),
      title: json.containsKey("title")
          ? StyledText.fromJson(json["title"] as Map<String, dynamic>)
          : StyledText(
              text: "Update count", color: ScanbotColor("?sbColorOnSurface")),
      info: json.containsKey("info")
          ? StyledText.fromJson(json["info"] as Map<String, dynamic>)
          : StyledText(
              text: "Adjust the number of items you scanned.",
              color: ScanbotColor("?sbColorOnSurfaceVariant")),
      updateButton: json.containsKey("updateButton")
          ? ButtonConfiguration.fromJson(
              json["updateButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: true,
              text: "Update",
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("?sbColorPrimary"),
                  fillColor: ScanbotColor("?sbColorPrimary"),
                  strokeWidth: 1.0),
              foreground: ForegroundStyle(
                  iconVisible: false,
                  color: ScanbotColor("?sbColorOnPrimary"),
                  useShadow: false)),
      cancelButton: json.containsKey("cancelButton")
          ? ButtonConfiguration.fromJson(
              json["cancelButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: true,
              text: "Cancel",
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("#00000000"),
                  fillColor: ScanbotColor("#00000000"),
                  strokeWidth: 1.0),
              foreground: ForegroundStyle(
                  iconVisible: false,
                  color: ScanbotColor("?sbColorPrimary"),
                  useShadow: false)),
      clearTextButton: json.containsKey("clearTextButton")
          ? IconStyle.fromJson(
              json["clearTextButton"] as Map<String, dynamic>)
          : IconStyle(
              visible: true, color: ScanbotColor("?sbColorOnSurfaceVariant")),
    );