flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.76k stars 27.64k forks source link

[SystemChrome] setting systemNavigationBarColor and statusBarColor to white turns dark #108855

Open marlonmp opened 2 years ago

marlonmp commented 2 years ago

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. When I set systemNavigationBar and statusBar color white, its torn dark.

Expected results:

$ flutter run
Launching lib/main.dart on Redmi Note 8 in debug mode...
lib/main.dart:1
βœ“  Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:44717/9iGzxjG7EOg=/ws
I/com.example.ap(11107): Waiting for a blocking GC ProfileSaver
I/com.example.ap(11107): WaitForGcToComplete blocked ProfileSaver on RunEmptyCheckpoint for 6.440ms
E/LB      (11107): fail to open file: No such file or directory
V/MiuiFrameworkFactory(11107): get AllImpl object = android.common.MiuiFrameworkFactoryImpl@f8c57c5
W/MirrorManager(11107): this model don't Support

Actual results:

Code sample ```dart import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({ super.key }); @override MyAppState createState() => MyAppState(); } class MyAppState extends State { @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarBrightness: Brightness.dark, statusBarIconBrightness: Brightness.dark, statusBarColor: Colors.white, systemNavigationBarIconBrightness: Brightness.dark, systemNavigationBarColor: Colors.white, ), ); return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: Container( alignment: Alignment.center, child: TextButton( onPressed: () {}, child: const Text('toggle theme'), ), ), ), ); } } ```
Logs ``` $ flutter run --verbose ... [ +3 ms] Flutter run key commands. [ +2 ms] r Hot reload. πŸ”₯πŸ”₯πŸ”₯ [ +1 ms] R Hot restart. [ ] h List all available interactive commands. [ ] d Detach (terminate "flutter run" but leave application running). [ ] c Clear the screen [ ] q Quit (terminate the application on the device). [ +3 ms] πŸ’ͺ Running with sound null safety πŸ’ͺ [ +1 ms] An Observatory debugger and profiler on Redmi Note 8 is available at: http://127.0.0.1:39071/Wz4H_F6EEX8=/ [ +879 ms] The Flutter DevTools debugger and profiler on Redmi Note 8 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:39071/Wz4H_F6EEX8=/ [ +160 ms] E/LB (14795): fail to open file: No such file or directory [+7992 ms] V/MiuiFrameworkFactory(14795): get AllImpl object = android.common.MiuiFrameworkFactoryImpl@f8c57c5 [ ] W/MirrorManager(14795): this model don't Support ``` ``` $ flutter analyze Analyzing app... No issues found! (ran in 3.1s) ``` ``` $ flutter doctor -v [βœ“] Flutter (Channel stable, 3.0.0, on Manjaro Linux 5.10.133-1-MANJARO, locale es_CO.utf8) β€’ Flutter version 3.0.0 at /home/marlon/Downloads/Repos/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision ee4e09cce0 (hace 3 meses), 2022-05-09 16:45:18 -0700 β€’ Engine revision d1b9a6938a β€’ Dart version 2.17.0 β€’ DevTools version 2.12.2 Checking Android licenses is taking an unexpectedly long time...[βœ“] Android toolchain - develop for Android devices (Android SDK version 32.0.0) β€’ Android SDK at /home/marlon/.android β€’ Platform android-32, build-tools 32.0.0 β€’ ANDROID_HOME = /home/marlon/.android β€’ Java binary at: /usr/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.16+8) β€’ All Android licenses accepted. [βœ—] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [βœ“] Linux toolchain - develop for Linux desktop β€’ clang version 14.0.6 β€’ cmake version 3.23.2 β€’ ninja version 1.11.0 β€’ pkg-config version 1.8.0 [!] Android Studio (not installed) β€’ Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [βœ“] VS Code β€’ VS Code at /snap/code/current β€’ Flutter extension version 3.46.0 [βœ“] Connected device (2 available) β€’ Redmi Note 8 (mobile) β€’ 12730032 β€’ android-arm64 β€’ Android 11 (API 30) β€’ Linux (desktop) β€’ linux β€’ linux-x64 β€’ Manjaro Linux 5.10.133-1-MANJARO [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available ! Doctor found issues in 2 categories. ```
Without SystemChrome set: With white color set: With blue color set:
image image image
maheshj01 commented 2 years ago

Hi @marlonmp, Thanks for filing the issue. I am not sure I understand the issue, Can you please share the expected behavior? I tried the below code sample and it seems to set the status bar color correctly

code sample ```dart import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({super.key}); @override MyAppState createState() => MyAppState(); } class MyAppState extends State { bool isDark = true; @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: Container( alignment: Alignment.center, child: TextButton( onPressed: () async { setState(() { isDark = !isDark; }); await Future.delayed(Duration(seconds: 1)); if (isDark) { SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarBrightness: Brightness.dark, statusBarIconBrightness: Brightness.dark, statusBarColor: Colors.white, systemNavigationBarIconBrightness: Brightness.dark, systemNavigationBarColor: Colors.white, ), ); } else { SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarBrightness: Brightness.light, statusBarIconBrightness: Brightness.light, statusBarColor: Colors.black, systemNavigationBarIconBrightness: Brightness.light, systemNavigationBarColor: Colors.black, ), ); } }, child: const Text('toggle theme'), ), ), ), ); } } ```
flutter doctor -v (mac) ``` [βœ“] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN) β€’ Flutter version 3.0.5 at /Users/mahesh/Documents/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700 β€’ Engine revision e85ea0e79c β€’ Dart version 2.17.6 β€’ DevTools version 2.12.2 [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) β€’ Android SDK at /Users/mahesh/Library/Android/sdk β€’ Platform android-32, build-tools 33.0.0-rc4 β€’ ANDROID_HOME = /Users/mahesh/Library/Android/sdk β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ CocoaPods version 1.11.2 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 2021.2) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [βœ“] IntelliJ IDEA Community Edition (version 2021.2.1) β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app β€’ Flutter plugin version 61.2.4 β€’ Dart plugin version 212.5080.8 [βœ“] VS Code (version 1.67.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.44.0 [βœ“] Connected device (3 available) β€’ sdk gphone arm64 (mobile) β€’ emulator-5554 β€’ android-arm64 β€’ Android 11 (API 30) (emulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 12.4 21F79 darwin-arm β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 103.0.5060.114 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available β€’ No issues found! ```
marlonmp commented 2 years ago

Hi @maheshmnj.

Thank you so much for your help.

Here is another example.

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {

  const MyApp({ super.key });

  @override
  MyAppState createState() => MyAppState();
}

class MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {

    // here I set statusBar and systemNavigationBar color to white
    SystemChrome.setSystemUIOverlayStyle(
      const SystemUiOverlayStyle(
        statusBarBrightness: Brightness.dark,
        statusBarIconBrightness: Brightness.dark,

        statusBarColor: Colors.white, // white

        systemNavigationBarIconBrightness: Brightness.dark,

        systemNavigationBarColor: Colors.white, // white
      ),
    );

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Container(
          alignment: Alignment.center,
          child: const Text( 'some text' ),
        ),
      ),
    );
  }
}

In the above code I set statusBarColor and systemNavigationBarColor to white and I get this.

Final result Expected result
My app Google play store app (example image)
image image
navigation bar black navigation bar white

In my app the systemNavigationBar color is black, but I set it to white.

maheshj01 commented 2 years ago

@marlonmp Can you please try upgrading to latest stable 3.0.5? Running your code sample I get the desired result

flutter doctor -v (mac) ``` [βœ“] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN) β€’ Flutter version 3.0.5 at /Users/mahesh/Documents/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700 β€’ Engine revision e85ea0e79c β€’ Dart version 2.17.6 β€’ DevTools version 2.12.2 [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) β€’ Android SDK at /Users/mahesh/Library/Android/sdk β€’ Platform android-32, build-tools 33.0.0-rc4 β€’ ANDROID_HOME = /Users/mahesh/Library/Android/sdk β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ CocoaPods version 1.11.2 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 2021.2) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [βœ“] IntelliJ IDEA Community Edition (version 2021.2.1) β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app β€’ Flutter plugin version 61.2.4 β€’ Dart plugin version 212.5080.8 [βœ“] VS Code (version 1.67.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.44.0 [βœ“] Connected device (3 available) β€’ sdk gphone arm64 (mobile) β€’ emulator-5554 β€’ android-arm64 β€’ Android 11 (API 30) (emulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 12.4 21F79 darwin-arm β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 103.0.5060.114 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available β€’ No issues found! ```
marlonmp commented 2 years ago

@maheshmnj I upgrated flutter to latest stable but get same result.

image

$ flutter doctor -v
[βœ“] Flutter (Channel stable, 3.0.5, on Manjaro Linux 5.10.133-1-MANJARO, locale
    es_CO.utf8)
    β€’ Flutter version 3.0.5 at /home/marlon/Downloads/Repos/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision f1875d570e (hace 3 semanas), 2022-07-13 11:24:16 -0700
    β€’ Engine revision e85ea0e79c
    β€’ Dart version 2.17.6
    β€’ DevTools version 2.12.2

[βœ“] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    β€’ Android SDK at /home/marlon/.android
    β€’ Platform android-32, build-tools 32.0.0
    β€’ ANDROID_HOME = /home/marlon/.android
    β€’ Java binary at: /usr/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.16+8)
    β€’ All Android licenses accepted.

[βœ—] Chrome - develop for the web (Cannot find Chrome executable at
    google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[βœ“] Linux toolchain - develop for Linux desktop
    β€’ clang version 14.0.6
    β€’ cmake version 3.23.2
    β€’ ninja version 1.11.0
    β€’ pkg-config version 1.8.0

[!] Android Studio (not installed)
    β€’ Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).

[βœ“] VS Code
    β€’ VS Code at /snap/code/current
    β€’ Flutter extension version 3.46.0

[βœ“] Connected device (2 available)
    β€’ Redmi Note 8 (mobile) β€’ 12730032 β€’ android-arm64 β€’ Android 11 (API 30)
    β€’ Linux (desktop)       β€’ linux    β€’ linux-x64     β€’ Manjaro Linux
      5.10.133-1-MANJARO

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available

! Doctor found issues in 2 categories.
maheshj01 commented 2 years ago

Thanks for the update @marlonmp, I am unable to reproduce the issue, I am able to set statusBarColor and systemNavigationBarColor, But statusBarIconBrightness and systemNavigationBarIconBrightness doesn't seem to work verified on Xiaomi k20 pro (Android 11).

    SystemChrome.setSystemUIOverlayStyle(
      const SystemUiOverlayStyle(
        statusBarBrightness: Brightness.dark,
        statusBarIconBrightness: Brightness.dark,
        statusBarColor: Colors.blue, // works
        systemNavigationBarIconBrightness: Brightness.light,
        systemNavigationBarColor: Colors.blue, // works
      ),
    );

output

Blue color White Color
flutter doctor -v (mac) ``` [βœ“] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN) β€’ Flutter version 3.0.5 at /Users/mahesh/Documents/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700 β€’ Engine revision e85ea0e79c β€’ Dart version 2.17.6 β€’ DevTools version 2.12.2 [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) β€’ Android SDK at /Users/mahesh/Library/Android/sdk β€’ Platform android-32, build-tools 33.0.0-rc4 β€’ ANDROID_HOME = /Users/mahesh/Library/Android/sdk β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ CocoaPods version 1.11.2 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 2021.2) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [βœ“] IntelliJ IDEA Community Edition (version 2021.2.1) β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app β€’ Flutter plugin version 61.2.4 β€’ Dart plugin version 212.5080.8 [βœ“] VS Code (version 1.67.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.44.0 [βœ“] Connected device (3 available) β€’ sdk gphone arm64 (mobile) β€’ emulator-5554 β€’ android-arm64 β€’ Android 11 (API 30) (emulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 12.4 21F79 darwin-arm β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 103.0.5060.114 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available β€’ No issues found! ``` ``` [βœ“] Flutter (Channel master, 3.1.0-0.0.pre.2009, on macOS 12.4 21F79 darwin-arm, locale en-IN) β€’ Flutter version 3.1.0-0.0.pre.2009 on channel master at /Users/mahesh/Documents/flutter_master β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision 9d96c7b8be (3 days ago), 2022-08-01 00:39:06 -0400 β€’ Engine revision cf0db3e546 β€’ Dart version 2.19.0 (build 2.19.0-49.0.dev) β€’ DevTools version 2.16.0 [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) β€’ Android SDK at /Users/mahesh/Library/Android/sdk β€’ Platform android-32, build-tools 33.0.0-rc4 β€’ ANDROID_HOME = /Users/mahesh/Library/Android/sdk β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Build 13C100 β€’ CocoaPods version 1.11.2 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 2021.2) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [βœ“] IntelliJ IDEA Community Edition (version 2021.2.1) β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app β€’ Flutter plugin version 61.2.4 β€’ Dart plugin version 212.5080.8 [βœ“] VS Code (version 1.69.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.46.0 [βœ“] Connected device (3 available) β€’ sdk gphone arm64 (mobile) β€’ emulator-5554 β€’ android-arm64 β€’ Android 11 (API 30) (emulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 12.4 21F79 darwin-arm β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 104.0.5112.79 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available β€’ No issues found! ```
zanderso commented 2 years ago

cc @jonahwilliams

jonahwilliams commented 2 years ago

There is a lot of behavior in https://github.com/flutter/engine/blob/c617fd74c9f2f6ac16aa89bbeaffa392b376c8eb/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java#L375-L466 that I don't see documented on the flutter side. We should probably clarify this a bit, because the combinations support here are hard for me to understand at a glance

farhanabdmusa commented 1 year ago

Hello @maheshmnj, when i'm in light mode, that code work perfectly, systemNavigationBarColor: Colors.white is working But when i switch to dark mode, that white color turn to black on Redmi Note 8 Pro

i've tried to force using light mode

      return AnnotatedRegion<SystemUiOverlayStyle>(
      value: const SystemUiOverlayStyle(
        statusBarBrightness: Brightness.dark,
        statusBarIconBrightness: Brightness.dark,
        statusBarColor: Colors.white, // works on light mode
        systemNavigationBarIconBrightness: Brightness.light,
        systemNavigationBarColor: Colors.white, // works on light mode
      ),
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'App Title',
        themeMode: ThemeMode.light,
        theme: ThemeData(
          fontFamily: 'PlusJakartaSans',
        ),
        home: const HomePage(),
      ),
    );

I've try on emulator when in dark mode and light mode, navigation bar colors is still white But when using my device Xiaomi Redmi Note 8 Pro, navigation bar colors turn to black

here is my flutter doctor -v

[βœ“] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-x64, locale en-ID)
    β€’ Flutter version 3.7.7 on channel stable at /Users/farhanabdurrahmanmusa/Development/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 2ad6cd72c0 (2 days ago), 2023-03-08 09:41:59 -0800
    β€’ Engine revision 1837b5be5f
    β€’ Dart version 2.19.4
    β€’ DevTools version 2.20.1
DongXuanLei commented 1 year ago

Hello @maheshmnj, when i'm in light mode, that code work perfectly, systemNavigationBarColor: Colors.white is working But when i switch to dark mode, that white color turn to black on Redmi Note 8 Pro

i've tried to force using light mode

      return AnnotatedRegion<SystemUiOverlayStyle>(
      value: const SystemUiOverlayStyle(
        statusBarBrightness: Brightness.dark,
        statusBarIconBrightness: Brightness.dark,
        statusBarColor: Colors.white, // works on light mode
        systemNavigationBarIconBrightness: Brightness.light,
        systemNavigationBarColor: Colors.white, // works on light mode
      ),
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'App Title',
        themeMode: ThemeMode.light,
        theme: ThemeData(
          fontFamily: 'PlusJakartaSans',
        ),
        home: const HomePage(),
      ),
    );

I've try on emulator when in dark mode and light mode, navigation bar colors is still white But when using my device Xiaomi Redmi Note 8 Pro, navigation bar colors turn to black

here is my flutter doctor -v

[βœ“] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-x64, locale en-ID)
    β€’ Flutter version 3.7.7 on channel stable at /Users/farhanabdurrahmanmusa/Development/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 2ad6cd72c0 (2 days ago), 2023-03-08 09:41:59 -0800
    β€’ Engine revision 1837b5be5f
    β€’ Dart version 2.19.4
    β€’ DevTools version 2.20.1

I have this problem too.