Home > Back-end >  Make Flutter AppBar's Color Consistent
Make Flutter AppBar's Color Consistent

Time:09-23

The screenshot of my flutter app shows the appbar to be in two distinct shades of the same colors. There's a darker grey and then there's a lighter grey. I want it to be in a single color, i.e., completely light grey or completely dark grey.

enter image description here

CodePudding user response:

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

void main() {
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    systemNavigationBarColor: Colors.amber, // navigation bar color
    statusBarColor: Colors.white, // status bar color
    statusBarIconBrightness: Brightness.dark, // status bar icon color
    systemNavigationBarIconBrightness: Brightness.dark, // color of navigation controls
  ));
  runApp(MyApp());
}

This will help you to change color of status bar

  • Related