Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter navigation drawer hamburger icon color change

Hamburger icon color of navigation drawer is not changing. Its black by default. I want to change the this icon color in flutter, I am stuck, help me to change this icon color. here is my code.

class Test extends StatefulWidget { @override _TestState createState() => new _TestState(); }  class _TestState extends State<Test> {       @override     Widget build(BuildContext context) {     return new Scaffold(      drawer: new Drawer(),     appBar: new AppBar(     title: new Text("Navigation Drawer")         ),        ),      );     }  } 
like image 367
Ammy Kang Avatar asked May 29 '18 08:05

Ammy Kang


People also ask

How do you change the drawer icon color in Flutter?

To change the drawer icon color in Flutter: Simply add the iconTheme property inside the AppBar widget and assign the IconThemeData(color: [your_color]).


1 Answers

Add iconTheme to your AppBar

@override Widget build(BuildContext context) {   return Scaffold(     drawer: Drawer(),     appBar: AppBar(       title: Text("Navigation Drawer"),       iconTheme: IconThemeData(color: Colors.green),     ),   ); } 

You can also check other solutions here.

like image 100
Phuc Tran Avatar answered Sep 18 '22 19:09

Phuc Tran