toJson method
Allows you to serialize object.
Implementation
Map<String, dynamic> toJson() => {
"showStatusMessages": showStatusMessages,
"showResultStatusMessages": showResultStatusMessages,
"showHelpAnimation": showHelpAnimation,
"showNextPageAnimation": showNextPageAnimation,
"showBackgroundMask": showBackgroundMask,
"cameraFrameBorderWidth": cameraFrameBorderWidth,
"cameraFrameLineLength": cameraFrameLineLength,
"cameraFrameShapeType": cameraFrameShapeType?.value,
"cameraFrameOffsetWidth": cameraFrameOffsetWidth,
"status": status,
"resultStatus": resultStatus,
"cameraFrameDefaultColor": _intFromColor(cameraFrameDefaultColor),
"cameraFrameActiveColor": _intFromColor(cameraFrameActiveColor),
"statusTextColor": _intFromColor(statusTextColor),
"resultStatusTextColor": _intFromColor(resultStatusTextColor),
"resultStatusBackgroundColor":
_intFromColor(resultStatusBackgroundColor),
"multipageButtonBackgroundColor":
_intFromColor(multipageButtonBackgroundColor),
"tintColor": _intFromColor(tintColor),
"activityIndicatorColor": _intFromColor(activityIndicatorColor),
"statusBackgroundColor": _intFromColor(statusBackgroundColor),
"cameraPreviewBackgroundColor":
_intFromColor(cameraPreviewBackgroundColor),
"statusPositionMultiplier": statusPositionMultiplier,
"resultStatusPositionMultiplier": resultStatusPositionMultiplier,
"toolbarSize": toolbarSize,
"backgroundMaskAlpha": backgroundMaskAlpha,
"customStatusPositionMultiplier": customStatusPositionMultiplier,
"cameraFrameVerticalPositionMultiplier":
cameraFrameVerticalPositionMultiplier,
"cameraFrameLandscapeAspectRatio": cameraFrameLandscapeAspectRatio,
"cameraFramePortraitAspectRatio": cameraFramePortraitAspectRatio,
"cameraFrameCornerRadius": cameraFrameCornerRadius,
"livenessAnimationPositionMultiplier":
livenessAnimationPositionMultiplier,
"multipageAnimationFrontImage":
_dataToBase64(multipageAnimationFrontImage),
"multipageAnimationBackImage":
_dataToBase64(multipageAnimationBackImage),
"borderBackgroundImage": _dataToBase64(borderBackgroundImage),
"helpAnimationImage": _dataToBase64(helpAnimationImage),
"closeButtonImage": _dataToBase64(closeButtonImage),
"captureButtonImage": _dataToBase64(captureButtonImage),
"cameraSwitchButtonImage": _dataToBase64(cameraSwitchButtonImage),
"torchButtonOnImage": _dataToBase64(torchButtonOnImage),
"torchButtonOffImage": _dataToBase64(torchButtonOffImage),
"changeFrameButtonExpandImage":
_dataToBase64(changeFrameButtonExpandImage),
"changeFrameButtonCollapseImage":
_dataToBase64(changeFrameButtonCollapseImage),
"livenessAnimationImage": _dataToBase64(livenessAnimationImage),
"customLabelStatus": customLabelStatus,
"cameraFrameLineCap": cameraFrameLineCap?.value,
"uiCustomizationLayer": uiCustomizationLayer,
"statusTextFont": statusTextFont?.toJson(),
"resultStatusTextFont": resultStatusTextFont?.toJson(),
"helpAnimationImageContentMode": helpAnimationImageTransformsIOS?.value,
"multipageAnimationFrontImageContentMode":
multipageAnimationFrontImageTransformsIOS?.value,
"multipageAnimationBackImageContentMode":
multipageAnimationBackImageTransformsIOS?.value,
"livenessAnimationImageContentMode":
livenessAnimationImageTransformsIOS?.value,
"borderBackgroundImageContentMode":
borderBackgroundImageTransformsIOS?.value,
"helpAnimationImageMatrix": helpAnimationImageTransformsAndroid,
"multipageAnimationFrontImageMatrix":
multipageAnimationFrontImageTransformsAndroid,
"multipageAnimationBackImageMatrix":
multipageAnimationBackImageTransformsAndroid,
"livenessAnimationImageMatrix": livenessAnimationImageTransformsAndroid,
"borderBackgroundImageMatrix": borderBackgroundImageTransformsAndroid,
"colors": colors.toJson(),
"fonts": fonts.toJson(),
"images": images.toJson(),
}.clearNulls();