wakelock_plus
1.8.2, released 4 weeks ago by fluttercommunity.dev
Keep the device screen awake across mobile, desktop, and web platforms.
What it does
Controls the screen wakelock to prevent a device display from dimming or turning off automatically. It provides simple imperative functions to enable, disable, or query the wakelock state across all supported platforms. Because it only manages the screen state rather than CPU background execution, it requires no special platform permissions.
AI-written summary of version 1.8.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Playing video or audio media where user interaction is absent but the display must stay active.
- Displaying long-form reading, dashboards, recipes, or presentation screens without unwanted screen timeouts.
- Targeting multiple platforms including mobile, desktop, and web with a unified screen wakelock API.
Skip it when
- You need background CPU processing while the screen is off (partial wakelocks are not supported).
- General window management or desktop-specific window controls are needed beyond keeping the display awake.
Strengths
- No special permissions required on any platform.
- Comprehensive platform support covering Android, iOS, macOS, Windows, Linux, and Web.
- Simple API with enable, disable, toggle, and status check methods.
Weaknesses
- High minimum SDK requirements (requires Flutter SDK >=3.41.0 and Dart SDK >=3.11.0).
- May require manual ndkVersion adjustments in Android Gradle configurations if errors arise.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
No permissions required. On Android, you may need to explicitly specify an NDK version in build.gradle if prompted.
import 'package:wakelock_plus/wakelock_plus.dart';
// Keep the screen awake
WakelockPlus.enable();
// Allow the screen to sleep again
WakelockPlus.disable();
// Check if wakelock is currently active
bool isEnabled = await WakelockPlus.enabled;Alternatives
Packages that do the same job and could replace wakelock_plus.
- window_manager
Pick if you need desktop window management (resizing, positioning, always-on-top) rather than just mobile/cross-platform screen wakelocks.
93Compare
Works with
Packages commonly used together with wakelock_plus: ones it builds on, ones built on it, and its own family.
- webwakelock_plus depends on itLightweight bindings for browser APIs via JS interop
- win32wakelock_plus depends on itCall common Windows APIs and COM objects directly from Dart using FFI.
- dbuswakelock_plus depends on itNative Dart D-Bus client for Linux and Windows.
- package_info_pluswakelock_plus depends on itFlutter plugin to query app package info like version, build number and installer store.
- chewieBuilt on wakelock_plusVideo player widget with Material/Cupertino controls
- media_kit_videoBuilt on wakelock_plusNative implementation for video playback in package:media_kit.
- better_player_plusBuilt on wakelock_plusA Flutter video player built on video_player with advanced features like playlists, subtitles, and PiP.
- flick_video_playerBuilt on wakelock_plusA customizable video player wrapper for Flutter that provides base architecture for custom UI.