createLiveness2DEstimator method Null safety

Liveness2DEstimator createLiveness2DEstimator(
  1. String ini_file
)

Creates a Liveness2DEstimator object (it's used evalute liveness of face).

Implementation

Liveness2DEstimator createLiveness2DEstimator(final String ini_file) {
  final livenessEstimatorConstructor =
      _dll_handle.lookupFunction<_Liveness2DEstimatorConstr_c, _Liveness2DEstimatorConstr_dart>(
          _c_namespace + 'FacerecService_createLiveness2DEstimatorE');
  Pointer<Pointer<Utf8>> _emptyPointerStrList = malloc.allocate(1);
  Pointer<Double> _emptyPointerDouble = malloc.allocate(1);
  final exception = _getException();

  final livenessEstimatorPointer = livenessEstimatorConstructor(
      _impl, (_facerecConfDir + ini_file).toNativeUtf8(), 0, _emptyPointerStrList, _emptyPointerDouble, exception);

  checkException(exception, _dll_handle);

  return Liveness2DEstimator(_dll_handle, livenessEstimatorPointer);
}