ScanbotAlertDialog.fromJson constructor

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

Implementation

factory ScanbotAlertDialog.fromJson(Map<String, dynamic> json) =>
    ScanbotAlertDialog(
      title: json.containsKey("title")
          ? StyledText.fromJson(json["title"] as Map<String, dynamic>)
          : StyledText(
              text: "Title", color: ScanbotColor("?sbColorOnSurface")),
      subtitle: json.containsKey("subtitle")
          ? StyledText.fromJson(json["subtitle"] as Map<String, dynamic>)
          : StyledText(
              text: "Standard explanation message text.",
              color: ScanbotColor("?sbColorOnSurfaceVariant")),
      sheetColor: json.containsKey("sheetColor")
          ? ScanbotColor(json["sheetColor"] as String)
          : ScanbotColor("?sbColorSurface"),
      modalOverlayColor: json.containsKey("modalOverlayColor")
          ? ScanbotColor(json["modalOverlayColor"] as String)
          : ScanbotColor("?sbColorModalOverlay"),
      dividerColor: json.containsKey("dividerColor")
          ? ScanbotColor(json["dividerColor"] as String)
          : ScanbotColor("?sbColorOutline"),
      okButton: json.containsKey("okButton")
          ? ButtonConfiguration.fromJson(
              json["okButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              background: BackgroundStyle(
                  fillColor: ScanbotColor("?sbColorPrimary"))),
      actionButton: json.containsKey("actionButton")
          ? ButtonConfiguration.fromJson(
              json["actionButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: false,
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("#00000000"),
                  fillColor: ScanbotColor("#00000000"),
                  strokeWidth: 0.0)),
      cancelButton: json.containsKey("cancelButton")
          ? ButtonConfiguration.fromJson(
              json["cancelButton"] as Map<String, dynamic>)
          : ButtonConfiguration(
              visible: true,
              background: BackgroundStyle(
                  strokeColor: ScanbotColor("#00000000"),
                  fillColor: ScanbotColor("#00000000"),
                  strokeWidth: 0.0)),
    );