Skip to content

Latest commit

 

History

History
 
 

desktop_lifecycle

desktop_lifecycle

Pub

Allow your flutter desktop application to perceive whether the window is activated.

Getting Started

  1. Add desktop_lifecycle to your pubspec.yaml.
  desktop_lifecycle: $latest_version
  1. Then you can use DesktopLifecycle.instance.isActive to listen window active event.
final ValueListenable<bool> event = DesktopLifecycle.instance.isActive;

final bool active = event.value;

event.addListener(() {
  debugPrint("window activate: ${event.value}");
});

LICENSE

see LICENSE file