How do I change the color of the flutter navbar?
how do I change the color of this icon
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: NavBar(),
);
}
}
This is my current code to show the navbar.
Can I change the color of the icon to blue for example?
3
Answers
Understanding your question you need to update the icon of the drawer icon. The drawer icon is part of the app bar you can use the leading property of the app bar to update the icon shown. Here is the sample code for doing the same.
Docs: https://docs.flutter.dev/cookbook/design/drawer
Leading property of App Bar: https://api.flutter.dev/flutter/material/AppBar/leading.html
Please find the complete example that you can use in your app. you can test this code here (https://docs.flutter.dev/cookbook/design/drawer) by replacing the code in the interactive example with the code below
To add style to an IconButton you would do something like this.
Hope it helps.