BarcodeItemConfiguration.fromJson constructor

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

Implementation

factory BarcodeItemConfiguration.fromJson(Map<String, dynamic> json) =>
    BarcodeItemConfiguration(
      imageVisible: json.containsKey("imageVisible")
          ? (json["imageVisible"] as bool)
          : true,
      titleSelected: json.containsKey("titleSelected")
          ? StyledText.fromJson(json["titleSelected"] as Map<String, dynamic>)
          : StyledText(
              text: "BARCODE_TITLE",
              color: ScanbotColor("?sbColorOnSurface")),
      subtitleSelected: json.containsKey("subtitleSelected")
          ? StyledText.fromJson(
              json["subtitleSelected"] as Map<String, dynamic>)
          : StyledText(
              text: "BARCODE_SUBTITLE",
              color: ScanbotColor("?sbColorOnSurfaceVariant")),
      titleDeselected: json.containsKey("titleDeselected")
          ? StyledText.fromJson(
              json["titleDeselected"] as Map<String, dynamic>)
          : StyledText(
              text: "BARCODE_TITLE",
              color: ScanbotColor("?sbColorOnSurface")),
      subtitleDeselected: json.containsKey("subtitleDeselected")
          ? StyledText.fromJson(
              json["subtitleDeselected"] as Map<String, dynamic>)
          : StyledText(
              text: "BARCODE_SUBTITLE",
              color: ScanbotColor("?sbColorOnSurfaceVariant")),
      backgroundSelected: json.containsKey("backgroundSelected")
          ? PolygonStyle.fromJson(
              json["backgroundSelected"] as Map<String, dynamic>)
          : PolygonStyle(
              strokeColor: ScanbotColor("?sbColorPositive"),
              fillColor: ScanbotColor("?sbColorPositive"),
              strokeWidth: 0.0,
              cornerRadius: 10.0),
      backgroundDeselected: json.containsKey("backgroundDeselected")
          ? PolygonStyle.fromJson(
              json["backgroundDeselected"] as Map<String, dynamic>)
          : PolygonStyle(
              strokeColor: ScanbotColor("?sbColorSurface"),
              fillColor: ScanbotColor("?sbColorSurface"),
              strokeWidth: 0.0,
              cornerRadius: 10.0),
    );