BarcodeInfoMapping.fromJson constructor

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

Implementation

factory BarcodeInfoMapping.fromJson(Map<String, dynamic> json) =>
    BarcodeInfoMapping(
      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"),
      loadingMessage: json.containsKey("loadingMessage")
          ? StyledText.fromJson(
              json["loadingMessage"] as Map<String, dynamic>)
          : StyledText(
              text: "Loading message for barcode info mapping.",
              color: ScanbotColor("?sbColorPrimary")),
      errorState: json.containsKey("errorState")
          ? BarcodeItemErrorState.fromJson(
              json["errorState"] as Map<String, dynamic>)
          : BarcodeItemErrorState(),
    );