currentBrightness property
Implementation
@override
Future<double> get currentBrightness async {
final brightness = await methodChannel.invokeMethod<double>(methodNameGetScreenBrightness);
if (brightness == null) {
throw PlatformException(code: "-9", message: "value returns null");
}
if (!brightness.isInRange(minBrightness, maxBrightness)) {
throw RangeError.range(brightness, minBrightness, maxBrightness);
}
return brightness;
}