搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫fluttercommunity/wakelock_plus

wakelock_plus

Flutter 插件,可在 Android、iOS、macOS、Windows、Linux 和 Web 上保持設備螢幕常亮。

wakelock_plus 專案封面
星標
110
分支
97
最近推送(UTC)
2026年9月1日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Wakelock Plus

GitHub stars Pub version

A continuation of the original Flutter plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping.

Supported platforms

Platform wakelock_plus support
Android ✅
iOS ✅
Web ✅
macOS ✅
Windows ✅
Linux ✅

Getting started

To learn more about the plugin and getting started, you can view the main package's README.

Plugin structure

This plugin plugin uses the federated plugins approach.

Android, iOS, macOS (via Hybrid Implementation), and Web use Platform Channels in their implementations. Windows and Linux are handled through Dart-only platform implementations.

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_plus_platform_interface package.

The packages in this repo are the following:

Package Implementations
wakelock_plus Main plugin package + Android, iOS, macOS, Windows, Linux, and Web implementations
wakelock_plus_platform_interface Basic API definition & message handling

Contributing

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

Origin

As stated before, this plugin is a continuation of the original wakelock plugin. That plugin was originally based on screen.

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

For this library, the functionality remains the same as the original plugin, but has been completely refreshed (using latest Flutter standards and platform integration) with support for all six platforms currently supported by Flutter (Android, iOS, macOS, Windows, Linux, and Web).

Migrating from the wakelock Plugin

Simply replace the import statement with the one below:

import 'package:wakelock_plus/wakelock_plus.dart';

As well as replacing all the calls to Wakelock with WakelockPlus:

WakelockPlus.enable();
//...
WakelockPlus.disable();
//...
WakelockPlus.toggle(enable: true);
Flutter Community GitHub avatar
GitHub 作者

Flutter Community ↗

A central place for all community made Flutter packages. To get started, see the README of the 'community' repository.

語言DartC++CMakeKotlinObjective-CJavaScriptRubySwiftHTMLC

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗