setBrightness method
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';
}
}
}