createCapturer2 method Null safety

Capturer createCapturer2(
  1. String ini_file
)

Similar to the FacerecService.createCapturer method.

Implementation

Capturer createCapturer2(String ini_file) {
  final capConstructor =
      _dll_handle.lookupFunction<_CapConstr_c, _CapConstr_dart>(_c_namespace + 'FacerecService_createCapturerE');
  Pointer<Pointer<Utf8>> _emptyPointerStrList = malloc.allocate(1);
  Pointer<Double> _emptyPointerDouble = malloc.allocate(1);
  final exception = _getException();

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

  checkException(exception, _dll_handle);

  return Capturer(_dll_handle, cap_pointer);
}