DEV Community

Discussion on: Flutter BLoC: Right way to Handle navigation

Collapse
 
aaabramenko profile image
AAAbramenko

We found a way how to navigate without BuildContext, but we need BuildContext to call BlocProvider.of<>(context)... I think I don't understand something, can you explain?

Collapse
 
pedromassango profile image
Pedro Massango

You always need to use the context do dispatch an action. What you can do it to use a unique instance of the NavigatorKey to navigate.

Collapse
 
furlongmt profile image
Matthew Furlong

Hey Pedro, I'm not sure I follow still. Is there another way you could explain this, possibly with an example?