close

How to change the appBar back button color in flutter

Hello Guys How are you all? Hope You all are fine. I want to change appbar default backBitton in flutter. How to change the appBar back button color in a flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

How this Error Occurs ?

I have appBar with a back button in a flutter. but I want to change my back button in a flutter.I cannot figure out how to change the appBar’s automatic back button to a different color. Here is My Code.

      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Text("FlutterCorner.com"),
        centerTitle: true,
      ),

How to change the appBar back button color in flutter ?

  1. How to change the appBar back button color in flutter?

    To change the appBar back button color in a flutter. You can use iconTheme property of the AppBar widget. It will change the appBar back button color in a flutter. You can set leading property to color. It will change the appBar back button color in flutter.

  2. change the appBar back button color in flutter

    To change the appBar back button color in a flutter. You can use iconTheme property of the AppBar widget. It will change the appBar back button color in a flutter. You can set leading property to color. It will change the appBar back button color in flutter.

Solution 1: use the iconTheme property 

You can use iconTheme property of AppBar widget. It will change the appBar back button color in flutter.

      appBar: AppBar(
        title: Text("FlutterCorner.com"),
        iconTheme: IconThemeData(
          color: Colors.black, //change your color here
        ),
        centerTitle: true,
      ),

Solution 2: change the color of the back button

You can set leading property to color. It will change the appBar back button color in flutter.

      appBar: AppBar(
        title: Text("FlutterCorner.com"),
        leading: BackButton(color: Colors.black),
        centerTitle: true,
      ),

Solution 3: handle the back button by yourself

      appBar: AppBar(
        title: Text("FlutterCorner.com"),
        centerTitle: true,
        leading: new IconButton(
          icon: new Icon(Icons.arrow_back, color: Colors.orange),
          onPressed: (){
            Navigator.of(context).pop();
          },
        ),
      ),

Output

How to change the appBar back button color in flutter,
change the appBar back button color in flutter,
button color in flutter,
change the appbar button colour,
appbar button color

Summery

So, It’s All About this tutorial. I hope this tutorial helps you to Solve your error. Please Comment Below if You stucks anywhere with my code. And please comment below on which solution worked for you. Thank You.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: