Flutter changing system navigation bar icon brightness

Viewed 1043

I have created 2 themes for my app a dark and a light one. These themes work perfectly on any phone except samsung s10 phones. On samsung s10 phones when the app is first started and the call to SystemChrome.setSystemUIOverlayStyle is made the navigation bar's icon color are not filled, it looks like only the borders are the color which I defined:

enter image description here

As soon as I tab out of the app and back in the icons look as they should.

enter image description here

This is also how it looks on any other phone when the app is started - as expected (but not for samsung s10).

This is the theme:

final DarkTheme = ThemeWrapper(
  themeData: ThemeData(
    brightness: Brightness.dark,
    accentColor: const Color(0xFF1976D2)
  ), 
  systemOverlay: SystemUiOverlayStyle(
      systemNavigationBarColor: Color(0xFF222222),
      systemNavigationBarIconBrightness: Brightness.light,
      statusBarColor: Color(0xFF222222),
  ),
);

And this is how I apply the systemUi:

SystemChrome.setSystemUIOverlayStyle(DarkTheme.systemOverlay);

Any Help woud be really appreciated.

Edit: This is indeed a flutter issue and not an android issue:

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getWindow().setNavigationBarColor(Color.parseColor("#222222"));
    }
}

This simple android native code achieves exactly what I need even on samsung s10 phones.

0 Answers
Related