Managers topic

AppFocusManager and OnlineManager tell a client when the app returns to the foreground and when the network comes back; NotifyManager batches listener notifications. Each client owns its own; the Flutter binding drives them.

Classes

AppFocusManager Managers
Tracks whether the app is in the foreground, so a mounted QueryClient can refetch stale queries when the user comes back (the refetchOnWindowFocus option) and resume work paused in the background.
NotifyManager Managers
Batches cache notifications so one cascade of cache writes produces one round of listener calls.
OnlineManager Managers
Tracks whether the device believes it has a network connection.

Typedefs

BatchNotifyFunction = void Function(void callback()) Managers
Wraps the delivery of a whole batch: must call the callback it is given exactly once. Install one with NotifyManager.setBatchNotifyFunction — in a UI framework, to apply every update of a batch in one frame. The default calls it directly.
FocusSetup = void Function() Function(void setFocused(bool? focused)) Managers
An adapter for AppFocusManager.setEventListener: installs a platform listener that reports focus through setFocused, and returns a function that removes the listener again.
NotifyFunction = void Function(void callback()) Managers
Wraps the delivery of a single notification: must call the callback it is given exactly once. Install one with NotifyManager.setNotifyFunction, for example to run each listener inside a zone or an error boundary. The default calls it directly.
OnlineSetup = void Function() Function(void setOnline(bool online)) Managers
An adapter for OnlineManager.setEventListener: installs a platform listener that reports connectivity through setOnline, and returns a function that removes the listener again.
ScheduleFunction = void Function(void callback()) Managers
Schedules when a batch of notifications runs: given the delivery as a callback, runs it now or later. The default is scheduleMicrotask; install one with NotifyManager.setScheduler (the Flutter binding installs a build-phase-aware one).