Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wakelock.enable() changes system Ui overlay style on Android #161

Closed
Stemo688 opened this issue Jan 4, 2022 · 6 comments
Closed

Wakelock.enable() changes system Ui overlay style on Android #161

Stemo688 opened this issue Jan 4, 2022 · 6 comments
Labels
requires further investigation The root cause of the issue has not yet been fully identified

Comments

@Stemo688
Copy link

Stemo688 commented Jan 4, 2022

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).

@creativecreatorormaybenot creativecreatorormaybenot added the requires further investigation The root cause of the issue has not yet been fully identified label Jan 11, 2022
@creativecreatorormaybenot creativecreatorormaybenot changed the title Wakelock.enable changes system Ui overlay style Wakelock.enable changes system Ui overlay style Jan 11, 2022
@creativecreatorormaybenot creativecreatorormaybenot changed the title Wakelock.enable changes system Ui overlay style Wakelock.enable() changes system Ui overlay style Jan 11, 2022
@troyredder
Copy link

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.

@creativecreatorormaybenot creativecreatorormaybenot changed the title Wakelock.enable() changes system Ui overlay style Wakelock.enable() changes system Ui overlay style on Android Jan 11, 2022
@creativecreatorormaybenot
Copy link
Owner

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.

@Plantake
Copy link

Plantake commented May 1, 2022

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.

@Holofox
Copy link

Holofox commented Jun 16, 2022

On Flutter 3.0.1, the problem is more relevant than ever.

@creativecreatorormaybenot
Copy link
Owner

@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.

@creativecreatorormaybenot
Copy link
Owner

I will soon discontinue this repository. Please use wakelock_plus: ^1.1.6 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires further investigation The root cause of the issue has not yet been fully identified
Projects
None yet
Development

No branches or pull requests

5 participants