setBrightness method

Future<void> setBrightness(
  1. double brightnes
)

Implementation

Future<void> setBrightness(double brightnes) async {
  if (!windows) {
    try {
      brightness.value = brightnes;
      ScreenBrightness().setScreenBrightness(brightnes);
      setUserPreferenceForBrightness();
    } catch (e) {
      print(e);
      throw 'Failed to set brightness';
    }
  }
}