fromJson static method

Functionality fromJson(
  1. dynamic jsonObject
)

Allows you to deserialize object.

Implementation

static Functionality fromJson(jsonObject) {
  var result = Functionality();
  result.testSetters = {};

  result.pictureOnBoundsReady = jsonObject["pictureOnBoundsReady"];
  result.showTorchButton = jsonObject["showTorchButton"];
  result.showCloseButton = jsonObject["showCloseButton"];
  result.videoCaptureMotionControl = jsonObject["videoCaptureMotionControl"];
  result.showCaptureButton = jsonObject["showCaptureButton"];
  result.showChangeFrameButton = jsonObject["showChangeFrameButton"];
  result.showSkipNextPageButton = jsonObject["showSkipNextPageButton"];
  result.useAuthenticator = jsonObject["useAuthenticator"];
  result.skipFocusingFrames = jsonObject["skipFocusingFrames"];
  result.showCameraSwitchButton = jsonObject["showCameraSwitchButton"];
  result.displayMetadata = jsonObject["displayMetadata"];
  result.isZoomEnabled = jsonObject["isZoomEnabled"];
  result.isCameraTorchCheckDisabled =
      jsonObject["isCameraTorchCheckDisabled"];
  result.recordScanningProcess = jsonObject["recordScanningProcess"];
  result.manualMultipageMode = jsonObject["manualMultipageMode"];
  result.singleResult = jsonObject["singleResult"];

  result.showCaptureButtonDelayFromDetect =
      jsonObject["showCaptureButtonDelayFromDetect"];
  result.showCaptureButtonDelayFromStart =
      jsonObject["showCaptureButtonDelayFromStart"];
  result.rfidTimeout = jsonObject["rfidTimeout"];
  result.forcePagesCount = jsonObject["forcePagesCount"];
  result.orientation =
      DocReaderOrientation.getByValue(jsonObject["orientation"]);
  result.captureMode = CaptureMode.getByValue(jsonObject["captureMode"]);
  result.cameraMode = CameraMode.getByValue(jsonObject["cameraMode"]);
  result.cameraPositionIOS =
      CameraPosition.getByValue(jsonObject["cameraPositionIOS"]);

  result.cameraFrame = DocReaderFrame.getByValue(jsonObject["cameraFrame"]);
  result.btDeviceName = jsonObject["btDeviceName"];

  result.zoomFactor = _toDouble(jsonObject["zoomFactor"]);
  result.exposure = _toDouble(jsonObject["exposure"]);

  result.excludedCamera2Models = jsonObject["excludedCamera2Models"] == null
      ? null
      : List<String>.from(jsonObject["excludedCamera2Models"]);

  result.cameraResolutionAndroid =
      CameraSize.fromJson(jsonObject["cameraSize"]);
  result.cameraResolutionIOS =
      CaptureSessionPreset.getByValue(jsonObject["videoSessionPreset"]);

  return result;
}