desktop_lifecycle 0.1.1
desktop_lifecycle: ^0.1.1 copied to clipboard
Allow your flutter desktop application to perceive whether the window is activated.
desktop_lifecycle #
Allow your flutter desktop application to perceive whether the window is activated.
Getting Started #
- Add
desktop_lifecycleto yourpubspec.yaml.
desktop_lifecycle: $latest_version
- Then you can use
DesktopLifecycle.instance.isActiveto 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