desktop_screenstate 0.0.1
desktop_screenstate: ^0.0.1 copied to clipboard
Flutter package to detect desktop screen is on or off.
screenstate #
(https://pub.dev/packages/screenstate)
Allow your flutter desktop application to check whether the screen is on or off.
Getting Started #
- Add
screenstate
to yourpubspec.yaml
.
screenstate: $latest_version
- Then you can use
ScreenState.instance.isActive
to listen window active event.
final ValueListenable<bool> event = ScreenState.instance.isActive;
final bool active = event.value;
event.addListener(() {
debugPrint("screen is on or off: ${event.value}");
});
value false means screen is on and value true means screen is off
LICENSE #
see LICENSE file