BarcodeItemErrorState.fromJson constructor

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

Implementation

factory BarcodeItemErrorState.fromJson(Map<String, dynamic> json) =>
    BarcodeItemErrorState(
      title: json.containsKey("title")
          ? StyledText.fromJson(json["title"] as Map<String, dynamic>)
          : StyledText(
              text: "Connection Error!",
              color: ScanbotColor("?sbColorOnSurface")),
      subtitle: json.containsKey("subtitle")
          ? StyledText.fromJson(json["subtitle"] as Map<String, dynamic>)
          : StyledText(
              text:
                  "There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",
              color: ScanbotColor("?sbColorOnSurfaceVariant")),
      retryButton: json.containsKey("retryButton")
          ? ButtonConfiguration.fromJson(
              json["retryButton"] as Map<String, dynamic>)
          : ButtonConfiguration(),
      cancelButton: json.containsKey("cancelButton")
          ? ButtonConfiguration.fromJson(
              json["cancelButton"] as Map<String, dynamic>)
          : ButtonConfiguration(),
    );