setScreenBrightness static method
Set screen brightness.
The range of value is 0.0, 1.0
Implementation
static Future<void> setScreenBrightness(double value) {
if (value < 0.0 || value > 1.0) {
return Future.error(
ArgumentError.value(
value,
"brightness value must be not null and in range [0.0, 1.0]",
),
);
} else if (Platform.isAndroid || Platform.isIOS) {
return _channel.invokeMethod("setBrightness", <String, dynamic>{
'brightness': value,
});
}
return Future.value();
}