Flutter – How to change drawer hamburger icon color

In this post, I will share you a few methods to change hamburger icon color on drawer menu.

1. Use iconTheme

@override
Widget build(BuildContext context) {
  return Scaffold(
    // ... 
    appBar: AppBar(
      // ...
      iconTheme: IconThemeData(color: Colors.green),
    ),
  );
}

2. Custom AppBar leading icon

@override
Widget build(BuildContext context) {
  return Scaffold(
    // ... 
    appBar: AppBar(
      // ...
      leading: Icon(Icons.menu, color: Colors.green)
    ),
  );
}

3. Use ThemeData

@override
Widget build(BuildContext context) {
  return Theme(
    data: ThemeData(
      primaryIconTheme: IconThemeData(color: Colors.red)),
    child: Scaffold(
      // ... 
      appBar: AppBar(
      // ...
      ),
    ),
  );
}

Tagged : / / /
Subscribe
Notify of
guest

1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
faffff
3 years ago

ss

1
0
Would love your thoughts, please comment.x
()
x