wakelock
wakelock copied to clipboard
`Wakelock.enable()` changes system Ui overlay style on Android
Calling Wakelock.enable changes system Ui overlay style to the one default of the system. In particularly, this changes the status bar icon brightness. This was tested on Android. Simply call Wakelock.enable after setSystemUIOverlayStyle with a different status bar icon brightness from the one of the system.
I suspect this isn't due to the Android plugin or the Flutter interface but due to the Android system and it's wakelock flag. Currently, I circumvent this by setting my custom overlay style based on my own app theme before and after the Wakelock call, since I enable it with low priority later in the initialization.
EDIT: I wasn't able to solve it by setting the overlay after the Wakelock call, I was forced to disable Wakelock (not call Wakelock.enable).
This is similar to my issue, so I will just post within this issue.
My issue is the status bar text color is changing and it occurs with enable or disable calls.
Attached is simple program with the issue. main.dart.zip
I have also put in an issue with Flutter since this appeared with the 2.8.x Flutter update.
hi :) I am not sure why this happens exactly - the only call that happens is setting the wakelock flag natively. This will require further investigation.
Yeah. I can confirm this. I called Wakelock.enalble() then it changes status bar icon brightness to Brightness.light and i have noticed this only occurs in android 11. This is a major problem.
On Flutter 3.0.1, the problem is more relevant than ever.
@Holofox @Plantake Any chance you can take a look into the native calls and check if this also happens when you manually execute the code natively?
It might be that the way the flag is handled changed with the newer version of Android, but I do not see exactly how I would fix it right now.