screen_brightness_util 0.0.3 copy "screen_brightness_util: ^0.0.3" to clipboard
screen_brightness_util: ^0.0.3 copied to clipboard

A flutter plugin to config and monitor brightness. Support Windows, Android and iOS platform.

screen_brightness_util #

A flutter plugin to config and monitor brightness.

Getting Started #

Get Brightness #

final ScreenBrightnessUtil _screenBrightnessUtil = ScreenBrightnessUtil();
double brightness = await _screenBrightnessUtil.getBrightness();
if(brightness == -1) {
  debugPrint("Oops... something wrong!");
}
copied to clipboard

Set Brightness #

double brightness = 0.5;
final ScreenBrightnessUtil _screenBrightnessUtil = ScreenBrightnessUtil();
bool success = await _screenBrightnessUtil.setBrightness(brightness);
copied to clipboard

Listen Brightness Change #

final ScreenBrightnessUtil _screenBrightnessUtil = ScreenBrightnessUtil();
StreamSubscription ss = _screenBrightnessUtil.getBrightnessChangeStream().listen((brightness) {
  debugPrint("brightness:$brightness");
});

...

ss.cancel();
copied to clipboard
4
likes
160
points
109
downloads

Publisher

verified publisherzyzdev.dev

Weekly Downloads

2024.08.11 - 2025.02.23

A flutter plugin to config and monitor brightness. Support Windows, Android and iOS platform.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, screen_brightness_util_android, screen_brightness_util_ios, screen_brightness_util_platform_interface, screen_brightness_util_windows

More

Packages that depend on screen_brightness_util