You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to manually call a global function and was expecting to be able to use dart-native's dynamic library runtimeLib. I've realized this is not exposed in the API and am wondering how I would access dart-native's dynamic library as is. My thoughts were DynamicLibrary.open('dart_native.framework/dart_native'); but I'm unsure as to whether I need to manually register a dealloc callback for the dynamic library in this scenario and whether my lib instance and yours would conflict.
below is all the code I'm using to access the global function. I should note, I'm getting syntax errors on this saying "Type given to lookup function must be a valid 'dart.ffi' native function type" despite CFURLRef doing nothing but extending a Struct class CFURLRef extends Struct{}
It's my understanding Struct is a native type. Any thoughts as to what's going on here?
DartNative doesn't support global C function for now, but you can call it using dart:ffi, here is the tutorial: https://dart.dev/guides/libraries/c-interop. The runtimeLib is private. You will create your native framework/library, it's not conflict with dart_native.framework.
When you pass an instance of NSObject or CGRect * to C function, you should pass its pointer.
I'm trying to manually call a global function and was expecting to be able to use dart-native's dynamic library
runtimeLib
. I've realized this is not exposed in the API and am wondering how I would access dart-native's dynamic library as is. My thoughts wereDynamicLibrary.open('dart_native.framework/dart_native');
but I'm unsure as to whether I need to manually register a dealloc callback for the dynamic library in this scenario and whether my lib instance and yours would conflict.below is all the code I'm using to access the global function. I should note, I'm getting syntax errors on this saying "Type given to lookup function must be a valid 'dart.ffi' native function type" despite CFURLRef doing nothing but extending a Struct
class CFURLRef extends Struct{}
It's my understanding Struct is a native type. Any thoughts as to what's going on here?
The text was updated successfully, but these errors were encountered: