The plugin should not alter screen brightness unless explicitly instructed to do so.
However, the plugin has a bug in lifecycle handling that causes the app to always reset the brightness to the initial state when it is about to be paused, even when no method of the plugin has ever been called.
Reproduce:
Create a minimal project and add this as a plugin in Pubspec.yaml, don’t modify other code. Compile and run
Quit app
Set Brightness to minimum via Control Center
Launch app
Set Brightness to maximum via Control Center
Return to Home Screen
-> brightness changes to minimum, which is unexpected
EDIT: Also, the Reset Brightness function always resets the brightness to the state when the application was initially launched. However, an iOS app might stay in background for a long time and the brightness has probably changed since then. We might want to update originalBrightness when calling setBrightness() or when the application resumes from background.
The plugin should not alter screen brightness unless explicitly instructed to do so.
However, the plugin has a bug in lifecycle handling that causes the app to always reset the brightness to the initial state when it is about to be paused, even when no method of the plugin has ever been called.
Reproduce:
EDIT: Also, the Reset Brightness function always resets the brightness to the state when the application was initially launched. However, an iOS app might stay in background for a long time and the brightness has probably changed since then. We might want to update
originalBrightness
when callingsetBrightness()
or when the application resumes from background.