Reputation: 1920
I have seen an example in flutter where you can navigate routes without having access to a BuildContext.
final GlobalKey<NavigatorState> _navKey = new GlobalKey<NavigatorState>();
navigatorKey.currentState.pushNamed('/');
Are there any drawbacks to doing all of my apps navigation with this method?
Upvotes: 7
Views: 1087
Reputation: 1920
No. There is no downside.
The performance concern is negligible in regards to screen switches.
Upvotes: 1