registerUIDartMethodsToCpp function

bool registerUIDartMethodsToCpp()

Implementation

bool registerUIDartMethodsToCpp() {
  DynamicLibrary? nativeDynamicLibrary = getDynamicLibrary();
  if (nativeDynamicLibrary == null) return false;
  final DartRegisterDartMethods _registerDartMethods =
  nativeDynamicLibrary.lookup<NativeFunction<NativeRegisterDartMethods>>('registerUIDartMethods').asFunction();
  Pointer<Uint64> bytes = malloc.allocate<Uint64>(_dartNativeMethods.length * sizeOf<Uint64>());
  Uint64List nativeMethodList = bytes.asTypedList(_dartNativeMethods.length);
  nativeMethodList.setAll(0, _dartNativeMethods);
  _registerDartMethods(bytes, _dartNativeMethods.length);
  return true;
}