Flutter Community
Published in

Flutter Community

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.




Articles and Stories from the Flutter Community

Recommended from Medium

The Art Of Programming #8

Elliptic Curve Cryptography — from a embedded software programmer’s view(2)

Tau Station Status Report: January

Analyzing your Node project in Sonarqube using Tekton Pipelines on IBM Cloud

Can Rockruff and Lycanroc be shiny in Pokémon GO?

Pokémon GO can Rockruff be shiny

Swift Optionals – Day 9

How to Create a Translator with Python

Automation Test Instrumentation with Katalon + CircleCI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Snir David

Snir David

Programming enthusiast. https://www.snir.dev

More from Medium

Why is Flutter Fast? — Part 1: Sublinear Building

[Solved] The argument type ‘Null Function(DataSnapshot)’ can’t be assigned to the parameter type…

TDD in Flutter Part 3: Testing your widgets

How to setup Flutter development environment for Android on Linux… I mean Windows