跪拜 Guibai
← All articles
Frontend · Flutter · Android

Flutter's Native Desktop Multi-Window API Lands on Master

By 恋猫de小郭 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Desktop-class Flutter apps can now manage multiple native windows without third-party plugins, using a unified widget tree that shares state across windows. This closes a long-standing gap for apps that need palettes, inspectors, or detached panels.

Summary

Flutter's long-awaited native multi-window support for desktop has reached a usable state on the master channel. The implementation defines five window types—regular, dialog, tooltip, popup, and satellite—each with its own controller and widget, all existing within a single widget tree that allows cross-window state sharing. Satellite windows can dock and undock from a parent, popups enforce on-screen visibility, and tooltips deliberately lack input focus.

Setting up requires switching to the master channel and enabling the windowing flag. Apps replace `runApp` with `runWidget`, and each window gets a `WindowController` that manages its title, size, and lifecycle. Event listening works through either a `WindowControllerDelegate` mixin or a `WindowScope` inherited widget. The API is functional on Windows and macOS, with Linux untested by the author.

Takeaways
Five window types are defined: regular, dialog, tooltip, popup, and satellite.
Satellite windows can dock into a parent or float independently and follow the parent's movement and resizing.
Popup windows enforce on-screen visibility so they are never clipped by screen edges.
Tooltip windows lack input focus and are meant for hover-based hints.
All windows live in one widget tree, enabling cross-window state sharing without extra plumbing.
Apps must use `runWidget` instead of `runApp` when adopting the multi-window API.
Window lifecycle events are accessible via `WindowControllerDelegate` mixin or `WindowScope` inherited widget.
The API is available on the master channel behind the `--enable-windowing` config flag.
Conclusions

Canonical's two-year stewardship of Flutter's desktop surface has produced a coherent windowing model that mirrors native platform expectations rather than bolting on a single-window workaround.

Placing all windows inside one widget tree is a deliberate architectural choice that sidesteps the complexity of inter-process or inter-isolate communication for state sharing.

The absence of Linux testing in this report is notable given Canonical's Ubuntu roots, suggesting the Linux implementation may lag behind macOS and Windows.

Concepts & terms
WindowController
An object that manages a native desktop window's properties (title, size) and lifecycle (create, update, destroy) in Flutter's multi-window API.
Satellite window
A child window that maintains its position relative to a parent window and can switch between floating and docked states.
WindowScope
An inherited widget that exposes a window's state (such as its title) to descendant widgets in the tree, enabling reactive access to window properties.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗