Skip to content
pubscout

screen_brightness

2.1.11, released 5 months ago by an unverified publisher

A Flutter plugin for controlling screen brightness with application lifecycle reset.

WASM-ready
$ flutter pub add screen_brightness
Source repository

What it does

Allows getting and setting application and system screen brightness levels. Provides streams to listen for brightness changes and automatically handles resetting brightness based on app lifecycle.

AI-written summary of version 2.1.11, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to adjust screen brightness from within a Flutter app.
  • You want to track system or application brightness changes using streams.

Skip it when

  • You only need to prevent the screen from sleeping (use wakelock instead).

Strengths

  • Supports multiple platforms including Android, iOS, Windows, macOS, and OHOS.
  • Provides application lifecycle reset implementation.
  • Includes brightness change streams.

Weaknesses

  • Adjusting system brightness on Android requires adding the WRITE_SETTINGS permission.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
6

To adjust system brightness on Android, add the WRITE_SETTINGS permission in your AndroidManifest.xml file.

Future<void> setApplicationBrightness(double brightness) async {
  try {
    await ScreenBrightness.instance
        .setApplicationScreenBrightness(brightness);
  } catch (e) {
    debugPrint(e.toString());
    throw 'Failed to set application brightness';
  }
}

Alternatives

Packages that do the same job and could replace screen_brightness.

Works with

Packages commonly used together with screen_brightness: ones it builds on, ones built on it, and its own family.