-
Notifications
You must be signed in to change notification settings - Fork 309
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
[Feature Request] Desktop support? #66
Comments
Hi! Thanks for opening your first issue here! 😄 |
Since desktop flutter allows ffi as well, there should be no problem imho. |
I just tested the example with windows and it crashes with late final dylib =
Platform.isAndroid ? DynamicLibrary.open('libflutter_rust_bridge_example.so') : DynamicLibrary.process();
// DynamicLibrary.process is not available on this platform Would this be a simple fix? (I have not looked into it just ran the simple example), and as expected dart:ffi does not work for web target at all XD wonder if there is room for a wasm implementation of this bridge 🤔 |
@yoroshikun This library does nothing but generate some Rust&Dart code, which human beings will write down manually without this lib. Therefore, maybe simply try to run a very simple Dart FFI + Rust program on desktop. If that works, my lib should work (and please tell me). For example, Dart using FFI to call a Rust function like |
As for why that example itself crashes, it is unrelated to this lib: That example (inspired from Flutter tutorial) opens |
Quickly testing it out with the most simple api and default flutter app as you said, have followed setup instructions, however seems to be having an issue finding a file but not sure what one. (Phase: Other things), both files do exist, it generates and places the rust generated part fine
|
No, that flutter app is not tested on desktop. I mean, following Flutter's official tutorials, to create a simplest Flutter app that runs on Desktop and talks to Rust via ffi - that simplest app should not use this package (yet). Instead, do a simple |
I did a bit of research. Seems that Flutter desktop has the ffi functionality, such as this or this (but they are of course complex and we do not need to do that). So this lib should work well as long as you set up the Flutter desktop app's ffi functionality successfully. I may modify my Theoretically, the code of this package itself should see no modification. Only the example tutorial needs to be modified. |
It would be great if we can have an example include supporting desktop, but I'm not capable to do this atm. |
Sure. I may add that later. |
Example is now added. #130 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
It's very inspiring to have such a library for those who like both flutter and rust, but it would be better if it can also support the desktop. Any plans on that ?
The text was updated successfully, but these errors were encountered: