how can i navigate between icons in the appBar on flutter?

582 views Asked by At

I am new flutter developer and I would like to browse among these icons in app bar,Any idea?

enter image description heretmy.png

2

There are 2 answers

0
ElsayedDev On BEST ANSWER

You can use Tab Bar, please check this : https://m.youtube.com/watch?v=r1sQTA_zPog

If you hope to do it with the hard way you can make a button for each icon and in onPressed add setState with Navigator and modified color

Check ; https://flutter.dev/docs/development/ui/navigation

0
Salim Murshed On

You can use like the below code for every icon.

IconButton(
        icon: Icon(Icons.add_box),
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => SecondRoute()),
          );
        },
      )