screen_brightness_util

Creator: coderz1093

Last updated:

Add to Cart

Description:

screen brightness util

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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.