createService method Null safety

FacerecService createService(
  1. String facerecConfDir,
  2. String licenseDir,
  3. String dllPath
)

Initializes the facerec library (can be called only once).

Use with custom path to facerec library (dllPath).
By default it is recommended to use FaceSdkPlugin.createFacerecService.

Implementation

static FacerecService createService(final String facerecConfDir, final String licenseDir, final String dllPath) {
  final DynamicLibrary dylib = DynamicLibrary.open(dllPath);

  final createService =
      dylib.lookupFunction<_facerecConstructor, _facerecConstructor>(_c_namespace + 'FacerecService_constructor2');

  final exception = _getException();
  final pointer =
      createService(facerecConfDir.toNativeUtf8(), licenseDir.toNativeUtf8(), dllPath.toNativeUtf8(), exception);
  checkException(exception, dylib);
  return FacerecService(dylib, pointer, facerecConfDir, dllPath);
}