Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make device top panel (status bar) have the same background color as AppBar in flutter?

Tags:

flutter

dart

How to make device top panel (status bar) have the same background color as AppBar in flutter? The color of the device top panel is always darker than the AppBar backgroundColor. Thanks a lot.

like image 682
sgon00 Avatar asked Nov 30 '22 22:11

sgon00


1 Answers

On iOS, this is already true.

On Android, add the following to onCreate in MainActivity.java, after the call to super.onCreate(savedInstanceState);.

getWindow().setStatusBarColor(0x00000000);

This will override the default status bar color of 0x40000000, which is set in the onCreate method of FlutterActivityDelegate.

enter image description here

like image 172
Collin Jackson Avatar answered Dec 04 '22 04:12

Collin Jackson