ArOverlayGeneralConfiguration.fromJson constructor
ArOverlayGeneralConfiguration.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ArOverlayGeneralConfiguration.fromJson(Map<String, dynamic> json) =>
ArOverlayGeneralConfiguration(
visible:
json.containsKey("visible") ? (json["visible"] as bool) : false,
counterBadge: json.containsKey("counterBadge")
? BadgeStyle.fromJson(json["counterBadge"] as Map<String, dynamic>)
: BadgeStyle(
background: BackgroundStyle(),
foregroundColor: ScanbotColor("?sbColorOnSurface")),
automaticSelectionEnabled: json.containsKey("automaticSelectionEnabled")
? (json["automaticSelectionEnabled"] as bool)
: false,
barcodeItemInfoPosition: json.containsKey("barcodeItemInfoPosition")
? BarcodeItemInfoPosition.values
.byName(json["barcodeItemInfoPosition"] as String)
: BarcodeItemInfoPosition.BELOW,
polygon: json.containsKey("polygon")
? ArOverlayPolygonConfiguration.fromJson(
json["polygon"] as Map<String, dynamic>)
: ArOverlayPolygonConfiguration(
visible: true,
deselected: PolygonStyle(),
selected: PolygonStyle()),
barcodeItemConfiguration: json.containsKey("barcodeItemConfiguration")
? BarcodeItemConfiguration.fromJson(
json["barcodeItemConfiguration"] as Map<String, dynamic>)
: BarcodeItemConfiguration(
imageVisible: true,
titleSelected: StyledText(
text: "BARCODE_TITLE",
color: ScanbotColor("?sbColorOnSurface")),
subtitleSelected: StyledText(
text: "BARCODE_SUBTITLE",
color: ScanbotColor("?sbColorOnSurfaceVariant")),
titleDeselected: StyledText(
text: "BARCODE_TITLE",
color: ScanbotColor("?sbColorOnSurface")),
subtitleDeselected: StyledText(
text: "BARCODE_SUBTITLE",
color: ScanbotColor("?sbColorOnSurfaceVariant")),
backgroundSelected: PolygonStyle(
strokeColor: ScanbotColor("?sbColorPositive"),
fillColor: ScanbotColor("?sbColorPositive"),
strokeWidth: 1.0,
cornerRadius: 5.0),
backgroundDeselected: PolygonStyle(
strokeColor: ScanbotColor("?sbColorSurface"),
fillColor: ScanbotColor("?sbColorSurface"),
strokeWidth: 1.0,
cornerRadius: 5.0)),
);