TopBarConfiguration.fromJson constructor
TopBarConfiguration.fromJson(
- Map<String, dynamic> json
)
Implementation
factory TopBarConfiguration.fromJson(Map<String, dynamic> json) =>
TopBarConfiguration(
title: json.containsKey("title")
? StyledText.fromJson(json["title"] as Map<String, dynamic>)
: StyledText(
visible: false,
text: "Scan Item",
color: ScanbotColor("?sbColorOnPrimary")),
mode: json.containsKey("mode")
? TopBarMode.values.byName(json["mode"] as String)
: TopBarMode.SOLID,
statusBarMode: json.containsKey("statusBarMode")
? StatusBarMode.values.byName(json["statusBarMode"] as String)
: StatusBarMode.LIGHT,
backgroundColor: json.containsKey("backgroundColor")
? ScanbotColor(json["backgroundColor"] as String)
: ScanbotColor("?sbColorPrimary"),
cancelButton: json.containsKey("cancelButton")
? ButtonConfiguration.fromJson(
json["cancelButton"] as Map<String, dynamic>)
: ButtonConfiguration(
text: "Cancel",
background: BackgroundStyle(
strokeColor: ScanbotColor("#00000000"),
fillColor: ScanbotColor("#00000000"),
strokeWidth: 0.0),
foreground:
ForegroundStyle(color: ScanbotColor("?sbColorOnPrimary"))),
);