desktop_lifecycle
Allow your flutter desktop application to perceive whether the window is activated.
Getting Started
- Add
desktop_lifecycle
to yourpubspec.yaml
.
desktop_lifecycle: $latest_version
- 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