toJson method

Map<String, dynamic> toJson()

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,
      "hologramAnimationPositionMultiplier":
          hologramAnimationPositionMultiplier,
      "multipageAnimationFrontImage":
          _imageToBase64(multipageAnimationFrontImage),
      "multipageAnimationBackImage":
          _imageToBase64(multipageAnimationBackImage),
      "borderBackgroundImage": _imageToBase64(borderBackgroundImage),
      "helpAnimationImage": _imageToBase64(helpAnimationImage),
      "closeButtonImage": _imageToBase64(closeButtonImage),
      "captureButtonImage": _imageToBase64(captureButtonImage),
      "cameraSwitchButtonImage": _imageToBase64(cameraSwitchButtonImage),
      "torchButtonOnImage": _imageToBase64(torchButtonOnImage),
      "torchButtonOffImage": _imageToBase64(torchButtonOffImage),
      "changeFrameButtonExpandImage":
          _imageToBase64(changeFrameButtonExpandImage),
      "changeFrameButtonCollapseImage":
          _imageToBase64(changeFrameButtonCollapseImage),
      "hologramAnimationImage": _imageToBase64(hologramAnimationImage),
      "customLabelStatus": customLabelStatus,
      "cameraFrameLineCap": cameraFrameLineCap?.value,
      "uiCustomizationLayer": uiCustomizationLayer,
      "statusTextFont": statusTextFont?.toJson(),
      "resultStatusTextFont": resultStatusTextFont?.toJson(),
      "helpAnimationImageContentMode": helpAnimationImageTransformsIOS?.value,
      "multipageAnimationFrontImageContentMode":
          multipageAnimationFrontImageTransformsIOS?.value,
      "multipageAnimationBackImageContentMode":
          multipageAnimationBackImageTransformsIOS?.value,
      "hologramAnimationImageContentMode":
          hologramAnimationImageTransformsIOS?.value,
      "borderBackgroundImageContentMode":
          borderBackgroundImageTransformsIOS?.value,
      "helpAnimationImageMatrix": helpAnimationImageTransformsAndroid,
      "multipageAnimationFrontImageMatrix":
          multipageAnimationFrontImageTransformsAndroid,
      "multipageAnimationBackImageMatrix":
          multipageAnimationBackImageTransformsAndroid,
      "hologramAnimationImageMatrix": hologramAnimationImageTransformsAndroid,
      "borderBackgroundImageMatrix": borderBackgroundImageTransformsAndroid,
    }.clearNulls();