Flutter app navigation state and menu pattern using BLoC
Navigation patterns for flutter are hard. And this is a scenario I stumbled upon and couldn’t find an agreed upon pattern to handle, so I made up one.
The scenario is this: You want to navigate to some “Views” of the app, and keep track of the current “View” for usage on some widget outside that view.
In my case, it was the
BottomNavigatonVar that needs to constantly have its
currentIndex parameter updated to the correct menu item we are viewing.