-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Is the app template only way to use nativeshell? Or can we integrate it into existing Flutter projects #3
Comments
You could take relevant parts from the template and add it to your project. That'd be everything rust and cargo related. Also NativeShell needs WindowWidget in the widget hierarchy, but you can make sure to add that on desktop platforms only. |
The documentation is very scarce indeed, I'm well aware of that :) |
There's one caveat. This will work as long as you don't require any native flutter plugins on desktop. These are not yet integrated with NativeShell / cargo build. I don't think this shouldn't be much of an issue in practice, since the functionality of NativeShell should cover much of what plugins would normally do. And you can easily call native (rust) code from NativeShell project if this is not enough. Still it is something I'd want to support eventually. |
Thanks for your quick response! When you say native flutter plugins, do you mean anything things like url_launcher, firebase, etc? Will plugins like bitsdojo_window conflict too? |
Yes. URL launcher functionality should definitely be covered by NativeShell itself. Firebase is trickier, I'm not even sure the official packages support desktop (maybe just MacOS).
|
@knopp I think external plugin support is really important. What about plugins for local storage like hive, or specifics like native_pdf_view, flutter_tts, device_info et cetera. Would NativeShell cover that? If not, would it even be possible to mix NativeShell and other plugins in the future? |
Hive is a package. It doesn't have any platform specific code. It should work without any issues. Support for packages with native code (plugins) should be possible, it just wasn't really a priority, since most plugins don't even support desktop platforms yet. |
I see. By any chance, do you plan on adding it to the roadmap if the demand for plugin support changes? |
Definitely. Added. |
I added issue to track progress of platform plugin support. |
Closing the issue, adding to custom projects is now described here. |
So do we no longer need to install Rust? Does everything we need come along with the nativeshell package now? |
You need to install Rust. Nativeshell is written in Rust and relies on the Rust package manager (cargo) to build the project. Installing Rust is really straightforward though. The original question was about adding Nativeshell to existing project. |
Understood, thanks |
There doesn't seem to be any documentation regarding this, one way or another.
The text was updated successfully, but these errors were encountered: