/wakelock

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, and web.

Primary LanguageDartBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Wakelock GitHub stars Pub version Twitter Follow

Wakelock is Flutter plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping.

Supported platforms

Platform wakelock support
Android
iOS
Web
macOS
Windows
Linux planned

Getting started

To learn more about the plugin and getting started, you can view the main package (wakelock) README.

Plugin structure

The wakelock plugin uses the federated plugins approach.
For this plugin, it means that the basic API is defined using pigeon. The pigeon files can be found in the pigeons directory in the main package. The API is defined in Dart in the wakelock_platform_interface package.
Furthermore, the Android and iOS implementations can be found in the main package, while the web implementation is in the wakelock_web package.

The packages in this repo are the following:

Package Implementations
wakelock Main plugin package + Android & iOS implementations
wakelock_macos macOS implementation
wakelock_platform_interface Basic API definition & message handling
wakelock_web Web implementation
wakelock_windows Windows implementation

Contributing

If you want to contribute to this plugin, follow the contributing guide.

Origin

Originally, this plugin was based on screen.
Specifically, the wakelock functionality was extracted into this plugin due to lack of maintenance by the author of the screen plugin.

Today, the wakelock plugin has been completely refreshed (using latest Flutter standards and platform integration) with added support for web, Windows, & macOS.