setForeground method

Future<void> setForeground(
  1. bool foreground
)

Tell the native core whether the host app is foregrounded, gating background polling and triggering an immediate drain of the queued event queue on the foreground transition. Wire this to AppLifecycleState changes (WidgetsBindingObserver).

Implementation

Future<void> setForeground(bool foreground) => _platform.setForeground(foreground);