resetScreenBrightness method
Reset screen brightness with (Android)-1 or (iOS)system brightness value.
This method is useful for user to reset screen brightness when user leave the page which has change the brightness value.
When _channel.invokeMethod
fails to get current brightness, it throws
PlatformException with code and message:
Code: -1, Message: Unable to change screen brightness Failed to reset brightness
Code: -2, Message: Unexpected error on null brightness System brightness in plugin is null
(Android only) Code: -10, Message: Unexpected error on activity binding Unexpected error when getting activity, activity may be null
Implementation
@override
Future<void> resetScreenBrightness() async {
await pluginMethodChannel.invokeMethod(methodNameResetScreenBrightness);
}