fromJson static method

  1. @visibleForTesting
FaceCaptureConfig? fromJson(
  1. dynamic jsonObject
)

Implementation

@visibleForTesting
static FaceCaptureConfig? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  var result = FaceCaptureConfig();

  result.copyright = jsonObject["copyright"];
  result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"];
  result.closeButtonEnabled = jsonObject["closeButtonEnabled"];
  result.torchButtonEnabled = jsonObject["torchButtonEnabled"];
  result.vibrateOnSteps = jsonObject["vibrateOnSteps"];
  result.detectOcclusion = jsonObject["detectOcclusion"];
  result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"];
  result.cameraPositionIOS =
      CameraPosition.getByValue(jsonObject["cameraPositionIOS"])!;
  result.screenOrientation =
      ScreenOrientation.fromIntList(jsonObject["screenOrientation"])!;
  result.timeout = _toDouble(jsonObject["timeout"]);
  result.holdStillDuration = _toDouble(jsonObject["holdStillDuration"]);

  return result;
}