WindowRegistry class
Process-wide registry for tracking secondary window states.
Unlike a traditional Dart singleton, the authoritative state lives entirely
in the native layer (the shared windowManagers_ C++ map, which is
static and therefore common to every Flutter engine in the process).
Every WindowRegistry instance delegates reads to the native layer, so
querying from any window - main or secondary - always returns consistent,
up-to-date data.
Reactive notifiers
activeWindows and hiddenWindows are ValueNotifiers that are refreshed
automatically by MultiWindowManager._methodCallHandler via refresh
whenever a lifecycle event arrives:
- kWindowEventInitialized - a new window registered itself
- kWindowEventClose - a window was truly destroyed
- kWindowEventReuseClose - a reuse-enabled window hid itself
- kWindowEventReuseShow - a hidden window became active again
These notifiers are per-isolate (Dart objects cannot be shared across Flutter engines), but because every engine receives the same global events and each then calls refresh, all notifiers converge to the same values within one event-loop tick.
Direct queries
getActiveWindowIds and getHiddenWindowIds always query the native layer on the spot and bypass the notifier cache. Use them when you need a guaranteed-fresh value (e.g. before opening a window).
MultiWindowManager.createWindowOrReuse uses these direct queries internally and therefore never depends on the per-isolate cache.
Constructors
Properties
-
activeWindows
→ ValueNotifier<
List< int> > -
Ids of currently active (visible or claimed-for-show) windows.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasHiddenWindows → bool
-
Whether there is at least one hidden window available for reuse.
no setter
-
Ids of hidden reuse-cached windows that are available for reuse.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
getActiveWindowIds(
) → Future< List< int> > - Queries the native layer for IDs of currently active windows.
-
getHiddenWindowIds(
) → Future< List< int> > - Queries the native layer for IDs of hidden reuse-cached windows.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → Future< void> - Queries the native layer and updates activeWindows and hiddenWindows.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited