focused property

  1. @override
ValueEmitter<bool> focused
final

true when this app currently has user focus.

  • macOS: tracks NSApplication active / resign via the native plugin.
  • Android: tracks app foreground / background via ProcessLifecycleOwner, so a backgrounded-but-alive process reports false.
  • Windows: tracks WM_ACTIVATEAPP on the app's window, so a minimized window or another app in front reports false.
  • iOS: the native plugin serves keepAwake only, so the emitter stays at its true default.

Implementation

@override
final ValueEmitter<bool> focused = ValueEmitter(true);