So as my question implies when I use an appBar my Android Nav Bar color changes from its default whitish color in Oreo to Black

so when my app starts my first Scaffold, doesn't use an app bar and only has a body with some content, but when I update state and replace it with a new scaffold with a new body and an app bar in an Android Oreo device the default white nav bar color changes to black, if i remove the app bar it doesn't happen, anyway I can prevent this?

this is my flutter doctor results if that matters:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.12.6 16G1408, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.26.1)
[✓] Connected devices (1 available)

! Doctor found issues in 1 category.

Edit:

By Navigation Bar, I mean the software navigation buttons of Android at the bottom not the status bar, this navigation bar consists of the "Home", "Recent" and "Back" buttons, some devices like the Galaxy S7 has hardware buttons instead of the software ones.


Solution 1: boformer

AppBar internally creates an AnnotatedRegion<SystemUiOverlayStyle> widget that is processed by Flutter's native UI bindings. It makes the status bar either dark or bright.


On screens with an AppBar, you can use its brightness property to change the status bar colour:

AppBar(
  brightness: Brightness.light,
  title: new Text('Flutter Test'),
)

Brightness.light results in a status bar with dark icons/text.


On screens without an AppBar, you can use AnnotatedRegion<SystemUiOverlayStyle> to set the color of the status bar.


Solution 2: king_below_my_lord

It seems it was a bug with flutter sdk, with the recent update the navigation bar colour doesn't auto change anymore when using an AppBar, for anyone's reference this is my flutter doctor result

    Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.6.0, on Mac OS X 10.12.6 16G1408, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.26.1)
[✓] Connected devices (1 available)