resetApplicationScreenBrightness method
Reset application screen brightness with (Android) -1 or (iOS)system brightness value.
This method is useful for user to reset application screen brightness when user leave the page which has change the application screen brightness value.
When _channel.invokeMethod
fails to get application screen brightness,
it throws PlatformException with code and message:
Code: -1, Message: Unable to reset application screen brightness Failed to reset application screen 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> resetApplicationScreenBrightness() async {
await pluginMethodChannel
.invokeMethod(methodNameResetApplicationScreenBrightness);
}