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 : / / /
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x