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(
      // ...
      ),
    ),
  );
}

If you are looking for mobile/web Software Engineers to build you next projects, please Contact Nextfunc team here!

Tagged : / / /
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
faffff
9 months ago

ss

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