How to. listen power setting notification using this package #912
Answered
by
halildurmus
alihassan143
asked this question in
Q&A
-
these are two notifications I want to listen to so I can set the user states |
Beta Was this translation helpful? Give feedback.
Answered by
halildurmus
Oct 17, 2024
Replies: 1 comment 4 replies
-
@halildurmus any idea? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible to listen to these notifications in Dart, but it requires a bit of setup.
To achieve this, you need to create an invisible Win32 window and run a message loop, which is a blocking operation. Therefore, this must be done in a separate isolate to avoid blocking the main isolate.
Here's an example that listens for
GUID_CONSOLE_DISPLAY_STATE
and session notifications: