-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter #7
Comments
There are other repos with Flutter templates (which you probably have found by now). I don't see a need to make another one. Just to clarify, why would Rust need JNI objects when using (C based) FFI? As far I understand, with Flutter you use C FFI for everything, so you don't have to touch JNI at all. Sorry for the late reply, for some reason I was not subscribed to all the notifications and didn't see this. |
Sometimes you need to call C code through plugin calls through JNI. For example, getting a C pointer to an opengl renderer so I can pass to the Rust library via FFI |
I'd solve this kind of situation at library level, i.e. the native (Android in this case) library used in the plugin would have a dedicated Rust binary with the JNI bindings. It would be invisible at plugin/Flutter level. |
I've been designing a Rust library for usage with Flutter. I see that you're doing Kotlin/Java <-> Rust here, but you mention Flutter.
Is there a plan to make a template for Flutter? Because there are 2 methods to consider: FFI vs Plugin call. Since plugin calls are very slow, FFI should be prefered, but what to do when Rust needs JNI objects? You can't pass them through Flutter's FFI
The text was updated successfully, but these errors were encountered: