r/FlutterDev • • Jul 11 '22

Tooling NativeShell for Flutter

https://matejknopp.com/post/introducing-nativeshell/
36 Upvotes

11 comments sorted by

11

u/ren3f Jul 11 '22

This article is already a year old, but looking at the github project it receives about an update each month, so even though it is still "in a very experimental stage" I'm happy the dev didn't stop once there was a POC.

22

u/airflow_matt Jul 11 '22

NativeShell author here. The project is still maintained (it's actually used to build a rather large Flutter application). There hasn't been much work on NativeShell directly right now because at some point I came to realisation that it contains more things than it should. For example right now I work on moving the Drag&Drop into a Flutter extension so that it is usable on all platforms.

So NativeShell in future should actually get leaner and cover the functionality that can not be in any way done with flutter plugins (like manage Flutter engines and windows, at least for the time being, or integration with cargo), and things that can be done as Flutter plugins should be moved out of NativeShell.

2

u/ren3f Jul 12 '22

Sounds good. Thanks for the work and open sourcing it!

3

u/anlumo Jul 11 '22

Oh wow, I was working on something similar in my spare time, but have only invested two evenings so far.

My main problem is that the embedders use different rendering APIs on all platforms (OpenGL ES/ANGLE/DX11 on Windows, OpenGL on Linux and Metal on macOS). I want to integrate wgpu with this, but it would mean having a completely separate core application for every platform. Also, using old rendering APIs for new development feels meh when new ones are available.

Is there a chance to get Windows and Linux to use Vulkan with this? Metal on macOS is rather easy to handle, but the other two are legacy stacked on top of each other.

2

u/airflow_matt Jul 11 '22

You can not do that at embedder level. At this point if you want to significantly change the rendering you'd need to fork the engine.

I don't think the embedder API (which desktop embedders use) even supports vulkan at this point.

2

u/anlumo Jul 11 '22

No, it's implemented. The Vulkan support in the embedder is just not used by any of the official ones.

1

u/airflow_matt Jul 11 '22

Thank you. Missed that. Still, pragmatically this would require forking the embedders at very least. Linux embedder is built on Gtk3, which doesn't support vulkan. Windows embedded uses Angle. Writing full features embedder is a deceptively large task, especially when considering things like keyboard handling / IME.

2

u/anlumo Jul 11 '22

Yes, if it would have been easy I'd already have done it. That's why I'm asking.

I looked into the problem and came to the same conclusions as you, but additionally accessibility also is an issue solved by the embedders.

1

u/[deleted] Jul 11 '22

As a flutter desktop enthusiast, this is awesome. Great work!