ReviewScreenConfiguration.fromJson constructor
ReviewScreenConfiguration.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ReviewScreenConfiguration.fromJson(Map<String, dynamic> json) =>
ReviewScreenConfiguration(
enabled: json.containsKey("enabled") ? (json["enabled"] as bool) : true,
showLastPageWhenAdding: json.containsKey("showLastPageWhenAdding")
? (json["showLastPageWhenAdding"] as bool)
: false,
topBarTitle: json.containsKey("topBarTitle")
? StyledText.fromJson(json["topBarTitle"] as Map<String, dynamic>)
: StyledText(
text: "?reviewScreenTitle",
color: ScanbotColor("?sbColorOnPrimary")),
topBarSubmitButton: json.containsKey("topBarSubmitButton")
? ButtonConfiguration.fromJson(
json["topBarSubmitButton"] as Map<String, dynamic>)
: ButtonConfiguration(
text: "?reviewScreenSubmitButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewSubmitButton",
background: BackgroundStyle(
strokeColor: ScanbotColor("?sbColorSurface"),
fillColor: ScanbotColor("?sbColorSurface"),
strokeWidth: 0.0),
foreground:
ForegroundStyle(color: ScanbotColor("?sbColorOnSurface"))),
topBarBackButton: json.containsKey("topBarBackButton")
? ButtonConfiguration.fromJson(
json["topBarBackButton"] as Map<String, dynamic>)
: ButtonConfiguration(
visible: true,
text: "?reviewTopBarBackButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewTopBarBackButton",
background: BackgroundStyle(
strokeColor: ScanbotColor("#00000000"),
fillColor: ScanbotColor("#00000000"),
strokeWidth: 0.0),
foreground: ForegroundStyle(
iconVisible: true,
color: ScanbotColor("?sbColorOnPrimary"),
useShadow: false)),
morePopup: json.containsKey("morePopup")
? ReviewMorePopupMenu.fromJson(
json["morePopup"] as Map<String, dynamic>)
: ReviewMorePopupMenu(),
zoomButton: json.containsKey("zoomButton")
? RoundButton.fromJson(json["zoomButton"] as Map<String, dynamic>)
: RoundButton(
accessibilityDescription:
"?accessibilityDescriptionReviewZoomButton",
backgroundColor: ScanbotColor("?sbColorSurfaceHigh"),
foregroundColor: ScanbotColor("?sbColorOnPrimary")),
zoomOverlay: json.containsKey("zoomOverlay")
? ZoomOverlay.fromJson(json["zoomOverlay"] as Map<String, dynamic>)
: ZoomOverlay(),
backgroundColor: json.containsKey("backgroundColor")
? ScanbotColor(json["backgroundColor"] as String)
: ScanbotColor("?sbColorOnSurfaceVariant"),
toolbar: json.containsKey("toolbar")
? ReviewToolbarConfiguration.fromJson(
json["toolbar"] as Map<String, dynamic>)
: ReviewToolbarConfiguration(),
switchNextPageButton: json.containsKey("switchNextPageButton")
? ScanbotIconButton.fromJson(
json["switchNextPageButton"] as Map<String, dynamic>)
: ScanbotIconButton(
color: ScanbotColor("?sbColorOnPrimary"),
accessibilityDescription:
"?accessibilityDescriptionReviewNextPageButton"),
switchPreviousPageButton: json.containsKey("switchPreviousPageButton")
? ScanbotIconButton.fromJson(
json["switchPreviousPageButton"] as Map<String, dynamic>)
: ScanbotIconButton(
color: ScanbotColor("?sbColorOnPrimary"),
accessibilityDescription:
"?accessibilityDescriptionReviewPreviousPageButton"),
pageCounter: json.containsKey("pageCounter")
? UserGuidanceConfiguration.fromJson(
json["pageCounter"] as Map<String, dynamic>)
: UserGuidanceConfiguration(
title: StyledText(
text: "?reviewScreenPageCount",
color: ScanbotColor("?sbColorOnPrimary")),
background: BackgroundStyle(
fillColor: ScanbotColor("?sbColorSurfaceHigh"),
strokeWidth: 0.0)),
deleteAllPagesAlertDialog: json.containsKey("deleteAllPagesAlertDialog")
? ScanbotAlertDialog.fromJson(
json["deleteAllPagesAlertDialog"] as Map<String, dynamic>)
: ScanbotAlertDialog(
title: StyledText(
text: "?reviewDeleteAllPagesAlertTitle",
color: ScanbotColor("?sbColorOnSurface")),
subtitle: StyledText(
text: "?reviewDeleteAllPagesAlertSubtitle",
color: ScanbotColor("?sbColorOnSurfaceVariant")),
okButton: ButtonConfiguration(
text: "?reviewDeleteAllPagesAlertDeleteButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",
background: BackgroundStyle(
fillColor: ScanbotColor("?sbColorPrimary"),
strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorOnPrimary"))),
actionButton: ButtonConfiguration(visible: false),
cancelButton: ButtonConfiguration(
text: "?reviewDeleteAllPagesAlertCancelButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",
background: BackgroundStyle(
fillColor: ScanbotColor("#00000000"), strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorPrimary")))),
deletePageAlertDialog: json.containsKey("deletePageAlertDialog")
? ScanbotAlertDialog.fromJson(
json["deletePageAlertDialog"] as Map<String, dynamic>)
: ScanbotAlertDialog(
title: StyledText(
text: "?reviewDeletePageAlertTitle",
color: ScanbotColor("?sbColorOnSurface")),
subtitle: StyledText(
text: "?reviewDeletePageAlertSubTitle",
color: ScanbotColor("?sbColorOnSurfaceVariant")),
okButton: ButtonConfiguration(
text: "?reviewDeletePageAlertConfirmButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",
background: BackgroundStyle(
fillColor: ScanbotColor("?sbColorPrimary"),
strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorOnPrimary"))),
actionButton: ButtonConfiguration(
text: "?reviewDeletePageAlertDeleteRetakeButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",
background: BackgroundStyle(
fillColor: ScanbotColor("#00000000"), strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorPrimary"))),
cancelButton: ButtonConfiguration(
text: "?reviewDeletePageAlertCancelButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewDeletePageAlertCancelButton",
background: BackgroundStyle(
fillColor: ScanbotColor("#00000000"), strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorPrimary")))),
reCroppingWarningAlertDialog: json
.containsKey("reCroppingWarningAlertDialog")
? ScanbotAlertDialog.fromJson(
json["reCroppingWarningAlertDialog"] as Map<String, dynamic>)
: ScanbotAlertDialog(
title: StyledText(
text: "?reviewReCroppingWarningAlertTitle",
color: ScanbotColor("?sbColorOnSurface")),
subtitle: StyledText(
text: "?reviewReCroppingWarningAlertSubtitle",
color: ScanbotColor("?sbColorOnSurfaceVariant")),
okButton: ButtonConfiguration(
text: "?reviewReCroppingWarningAlertContinueButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewReCroppingWarningAlertContinueButton",
background: BackgroundStyle(
fillColor: ScanbotColor("?sbColorPrimary"),
strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorOnPrimary"))),
actionButton: ButtonConfiguration(visible: false),
cancelButton: ButtonConfiguration(
text: "?reviewReCroppingWarningAlertCancelButtonTitle",
accessibilityDescription:
"?accessibilityDescriptionReviewReCroppingWarningAlertCancelButton",
background: BackgroundStyle(
fillColor: ScanbotColor("#00000000"), strokeWidth: 0.0),
foreground: ForegroundStyle(
color: ScanbotColor("?sbColorPrimary")))),
accessibilityDescriptionDocumentImagePreview:
json.containsKey("accessibilityDescriptionDocumentImagePreview")
? json["accessibilityDescriptionDocumentImagePreview"] as String
: "?accessibilityDescriptionDocumentImagePreview",
);