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: ButtonConfiguration.fromJson(
          json["okButton"] as Map<String, dynamic>),
      cancelButton: ButtonConfiguration.fromJson(
          json["cancelButton"] as Map<String, dynamic>),
    );