has anyone here used/seen kotlin/native used with ...
# kotlin-native
d
has anyone here used/seen kotlin/native used with flutter via dart ffi?
s
The main issue in using the ffi interface would be the objects being accessed by the garbage collector off of the thread the objects were created on. As soon as it would touch a non-frozen object, the kotlin runtime would throw an exception. It is possible to only share frozen objects to Dart and stick the mutable state inside of atomics but I don’t know how practical it would be. You might just be better off using the plugin architecture and passing messages asynchronously. IIRC that all happens on the main thread and won’t create difficulties.
d
thank you for your insight - i naively assumed ffi was the correct approach, but maybe plugin is right