r/FlutterDev • u/driftwood_studio • Jun 30 '26
Discussion Flutter desktop multi-window, wait or use existing packages??
Flutter multi-window support is actively being developed, but slowly. I'm not aware of any imminent indication that it's going to get moved to production-ready. Someday. Not today. Not soon.
My desktop application desperately needs this, but not just "another widow." The application is a document editor, so I basically need shared state across windows: the ability for app to know if a file is open in any existing window, ability to drag/drop content from one window to another, ability to move a document tab from window A to window B, etc.
So if I just needed another window for additional separate content, I'd go ahead and implement it using existing packages in pub.dev... but the issue is that these effectively boot a second (independent) flutter engine into a second rendering canvas (window), where each window is a silo with an extremely primitive "messaging" capability via the hostOS between windows. It's basically "boot a second copy of your application into a second window" not a single app controlling two windows.
My question: has anyone who's implemented using the existing packages had to deal with significant integration between "instances" in those windows? How did that go?
Alternatively, is anyone able to point me to details I missed as to plans/timelines for current multi-window support work being declared production ready and merged into flutter core?
[Note: sorry if this is a duplicate. I thought I'd posted it earlier today, but it appears nowhere in my post history -- some post error I didn't notice before closing the window maybe? Not sure.]
Edit: if it's not clear what I'm talking about with "single window implementation", there's a 20 second movie in the first "about this app" feature item on the beta signup page (https://fractaloutliner.app). Note that you should mostly ignore everything else. The beta signups and app availability are technically live, but but this is literally the first public mention of it I've made anywhere. The beta isn't really "public" yet.
3
u/Comun4 Jun 30 '26
It's already in the preview phase
https://github.com/flutter/flutter/tree/master/examples%2Fmultiple_windows
You can use this approach confindently, afaik
2
u/Significant_Pick8297 Jun 30 '26
I'd build around the preview multi-window API instead of waiting, but I'd also keep all shared state outside the Flutter window itself. Treat each window as just a UI client and have a single process own the document registry, undo history, drag/drop state, and file locking.
That way, if Flutter changes parts of the preview API later, you're mostly swapping the window layer instead of rewriting your document architecture. It also scales much better if you eventually want things like detached inspectors, floating tool panels, or collaborative features.
1
u/gsl2hz Jun 30 '26
Few years ago I built something similar, by building a small local backend server that handle data sync between windows with websocket. The server can be built with python or a backend dart package like shelf
I think that's a good design, you can add more functionalities as you like to that backend, not just to solve the multi windows problem. The first windows that start will create the backend, the others will not. The backend will need to be detached from the app which started it, so if you close the first window, it's still there.
Later you can upgrade this backend to a cloud server too.
1
u/eibaan Jun 30 '26
I'd do two things:
Then test the alternatives and decide. For option 2 (or 3) to be really alternative, you'd probably need a few other pain points before you abandon Flutter, but I'd always consider this.
And if I say "build", I of course mean "ask an AI to do so".
PS: I'd guess that the most difficult thing would be to not simply show a cursor with a green + while dragging but an actually image of the subtree you want to move, so you probably have to synchronize the position of a small irregular formed floating window with the mouse position.
-1
u/yrustupid Jun 30 '26
There’s no hope for Flutter.
Desktop apps demand better performance, but
Dart’s shitty single-threaded `isolate` model…
C# is coming out with `union` types next. It’s actively evolving. The C# compiler team is 100 times better.
The Dart team is just terrible.
Keyboard navigation is also important in desktop apps, but Flutter’s keyboard focus is buggy