Skip to content Skip to sidebar Skip to footer

How To Sync Bottom Navigation Bar Icon With Current Page In Flutter

I have here 5 pages. I want when the user routes to a new page without using bottom navigation bar for the icon for that page to appear in the bottom navigation bar. How can I do t

Solution 1:

Made a short example. Dartpad example

You have to get the state object of the parent in the child widget and use it to set the state of the parent. Make sure to check if the parent is mounted before calling set state as shown in the example.

Hope this solves your problem!

Post a Comment for "How To Sync Bottom Navigation Bar Icon With Current Page In Flutter"