setBrightness method

void setBrightness(
  1. double brightness
)

Implementation

void setBrightness(double brightness) async {
  await ScreenBrightness().setScreenBrightness(brightness);
  await Future.delayed(const Duration(seconds: 5));
  showBrightnessWidget = false;
  updateUI();
}