Repository navigation
Samsung Galaxy S10 System Navigation Bar Icon Brightness Issue #39132
Description
Activity
Just did a bit of research, check this out. Also, apparently setting
AppBar.brightnesscan do the trick.Did you see my code? I've tried everything.
Right, I see that now. From your description, it seems like a call to
buildsolves your problem. If you put a print statement in yourbuildfunction, does it call after closing and re-opening your app (ie, when the problem starts)?See
WidgetsBindingObserverfor how exactly to hook up asetStateto an app startup. I believe you are interested specifically inWidgetsBindingObserver.didChangeAppLifeCycleStatewhenstateisAppLifeCycleState.resumedThanks for your help! That seemed to work.
Glad to help!
I'm reopening the issue because the cause of this seems to be the
AppBar. Without theAppBar, the issue with the white status bar icons goes away when I relaunch the app.So... did the
WidgetsBindingObserverthing not work? Or are you saying that the cause of the issue should be fixed?Well I have two projects, one where I don't use an
AppBarorWidgetsBindingObserverand it works fine and the one I'm currently working on uses anAppBarand the navigation buttons turn white on the white theme. I was usingWidgetsBindingObserverwhich worked okay-ish but I refactored my project two months ago and decided to get rid of it. Both projects use the exact same code to change theme and the only difference is theAppBarnot being on the pages.I didn't notice the change when I removed
WidgetsBindingObserverbecause I was testing on my physical device and removed the navigation bar since I got Android 10 around there but I was playing around with it today and spent hours trying to figure out why it happened.I was using
WidgetsBindingObserverwhich worked okay-ishMind elaborating? That might give more clues on what the core issue is here.
WidgetsBindingObserverworked fine for my case as on resume, it changed the navigation bar color, but it's not necessary and plus my implementation of it wasn't so good as every widget had to be aStatefulWidget(atleast how I did it inside ofinitState) since it had to be on every page so no matter which page the user left on, it would work. The real issue is why theAppBarhas such an impact on the system navigation bar.Could it be this?
appBar: AppBar( iconTheme: IconThemeData(color: Colors.black), backgroundColor: Colors.white, brightness: Brightness.light, // over here // ...
That code is old, but no it's not, I've tried both brightness' and got the same result. I thought the same thing at first.
11 remaining items
- addedhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
on Sep 15, 2020 - addedengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-androidAndroid applications specificallyAndroid applications specifically
on Oct 14, 2020 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Dec 9, 2020 - addedteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
on Jul 8, 2023 I verified this issue using code sample provided above running on latest stable version with Samsung S10 device, with which I wasn't able to replicate the reported error.
I'll optimistically close this as not reproducible and also the fact that there have not been any activity recently.
If anybody still thinks this is an issue on latest version, please file a new issue with relevant details so that we can address it properly.- addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Mar 27, 2024 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Apr 10, 2024
I'm testing on my Samsung Galaxy S10 device and the code works once and when I close and reopen the app, the navigation bar has all of its icons white. To get the navigation bar icons to go dark again, I have to hit the green refresh button in VS Code while in debug mode. Then, the navbar icons turn dark until I close the app and reopen it. However, if I force stop it, the icons turn dark which is what I want but I'm worried that when I build my app that if a user just leaves the app for a second and comes back, their navigation bar would be all messed up and they wouldn't be able to see the buttons. I just want to be able to know why this happens and find a way to fix it.
Expected Result:


Actual Result:
Code:
Cmd: flutter doctor -v