fromJson static method

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

Implementation

@visibleForTesting
static VerificationConfig? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  var result = VerificationConfig(jsonObject["personId"]);

  result.copyright = jsonObject["copyright"];
  result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"];
  result.closeButtonEnabled = jsonObject["closeButtonEnabled"];
  result.torchButtonEnabled = jsonObject["torchButtonEnabled"];
  result.vibrateOnSteps = jsonObject["vibrateOnSteps"];
  result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"];
  result.cameraPositionIOS =
      CameraPosition.getByValue(jsonObject["cameraPositionIOS"])!;
  result.screenOrientation =
      ScreenOrientation.fromIntList(jsonObject["screenOrientation"])!;
  result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"];
  result.preventScreenRecording = jsonObject["preventScreenRecording"];
  result.attemptsCount = jsonObject["attemptsCount"];
  result.recordingProcess =
      RecordingProcess.getByValue(jsonObject["recordingProcess"])!;
  result.livenessType = LivenessType.getByValue(jsonObject["livenessType"])!;
  result.tag = jsonObject["tag"];
  result.skipStep =
      LivenessSkipStep.fromIntList(jsonObject["screenOrientation"])!;
  result.metadata = jsonObject["metadata"];
  result.groupId = jsonObject["groupId"];
  result.threshold = _toDouble(jsonObject["threshold"]);

  return result;
}