Skip to content
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

Closed
GroovinChip opened this issue Jun 3, 2021 · 14 comments

Comments

@GroovinChip
Copy link

There doesn't seem to be any documentation regarding this, one way or another.

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

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.

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

The documentation is very scarce indeed, I'm well aware of that :)

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

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.

@GroovinChip
Copy link
Author

GroovinChip commented Jun 3, 2021

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?

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

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).

bitsdojo_window will not work because the platform plugin (native code) will not be loaded. It also shouldn't be necessary as NativeShell is expected cover all relevant functionality. Right now it is missing things like minimize/maximize methods and window states, but that quite high on my priority list.

@wilsonowilson
Copy link

@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?

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

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.

@wilsonowilson
Copy link

I see. By any chance, do you plan on adding it to the roadmap if the demand for plugin support changes?

@knopp
Copy link
Contributor

knopp commented Jun 3, 2021

Definitely. Added.

@knopp
Copy link
Contributor

knopp commented Jun 5, 2021

I added issue to track progress of platform plugin support.

@knopp
Copy link
Contributor

knopp commented Jun 14, 2021

Closing the issue, adding to custom projects is now described here.

@knopp knopp closed this as completed Jun 14, 2021
@GroovinChip
Copy link
Author

So do we no longer need to install Rust? Does everything we need come along with the nativeshell package now?

@knopp
Copy link
Contributor

knopp commented Jun 14, 2021

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.

@GroovinChip
Copy link
Author

Understood, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants