Repository navigation
Samsung Galaxy S10 System Navigation Bar Icon Brightness Issue #39132
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencee: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.21Found to occur in 1.21Found to occur in 1.21found in release: 1.22Found to occur in 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
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:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light.copyWith(
systemNavigationBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.dark));
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'School Life',
home: HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
),
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
brightness: Brightness.light,
elevation: 0,
centerTitle: true,
title: Text("Home",
style: TextStyle(
color: Colors.black,
fontFamily: 'OpenSans',
fontWeight: FontWeight.w600)),
),
drawer: CustomDrawer(),
);
}
}
Cmd: flutter doctor -v
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.18362.295], locale en-US)
• Flutter version 1.7.8+hotfix.4 at C:\flutter
• Framework revision 20e59316b8 (5 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Owner\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = C:\Users\Owner\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 38.2.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.37.1)
• VS Code at C:\Users\Owner\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.3.0
[√] Connected device (1 available)
• SM G973U • R38M20KGKPK • android-arm64 • Android 9 (API 28)
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencee: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.21Found to occur in 1.21Found to occur in 1.21found in release: 1.22Found to occur in 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
Levi-Lesches commentedon Aug 25, 2019
Just did a bit of research, check this out. Also, apparently setting
AppBar.brightnesscan do the trick.Reprevise commentedon Aug 25, 2019
Did you see my code? I've tried everything.
Levi-Lesches commentedon Aug 25, 2019
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)?Levi-Lesches commentedon Aug 25, 2019
See
WidgetsBindingObserverfor how exactly to hook up asetStateto an app startup. I believe you are interested specifically inWidgetsBindingObserver.didChangeAppLifeCycleStatewhenstateisAppLifeCycleState.resumedReprevise commentedon Aug 26, 2019
Thanks for your help! That seemed to work.
Levi-Lesches commentedon Aug 26, 2019
Glad to help!
Reprevise commentedon Feb 16, 2020
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.Levi-Lesches commentedon Feb 16, 2020
So... did the
WidgetsBindingObserverthing not work? Or are you saying that the cause of the issue should be fixed?Reprevise commentedon Feb 16, 2020
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.Levi-Lesches commentedon Feb 16, 2020
Mind elaborating? That might give more clues on what the core issue is here.
Reprevise commentedon Feb 16, 2020
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.Levi-Lesches commentedon Feb 16, 2020
Could it be this?
Reprevise commentedon Feb 16, 2020
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
darshankawar commentedon Mar 27, 2024
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.
github-actions commentedon Apr 10, 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.