createRecognizer method Null safety

Recognizer createRecognizer(
  1. String ini_file,
  2. {bool processing = true,
  3. bool matching = true,
  4. bool processing_less_memory_consumption = false}
)

Creates a Recognizer object (it's used to create face templates and compare them).

Implementation

Recognizer createRecognizer(final String ini_file,
    {final bool processing = true,
    final bool matching = true,
    final bool processing_less_memory_consumption = false}) {
  final recConstructor = _dll_handle
      .lookupFunction<_RecognizerConstr_c, _RecognizerConstr_dart>(_c_namespace + 'FacerecService_createRecognizer2');
  Pointer<Pointer<Utf8>> _emptyPointerStrList = malloc.allocate(1);
  Pointer<Double> _emptyPointerDouble = malloc.allocate(1);
  final exception = _getException();

  final recPointer = recConstructor(
      _impl,
      (_facerecConfDir + ini_file).toNativeUtf8(),
      0,
      _emptyPointerStrList,
      _emptyPointerDouble,
      processing ? 1 : 0,
      matching ? 1 : 0,
      processing_less_memory_consumption ? 1 : 0,
      exception);

  checkException(exception, _dll_handle);

  return Recognizer(_dll_handle, recPointer);
}