DEV Community

Discussion on: Flutter BLoC: Right way to Handle navigation

Collapse
 
marnore profile image
Marius Noreikis

I only got it working after I changed the code to the following:

child: MaterialApp(
navigatorKey: _navigatorKey,
title: 'My App',
home: HomePage(),
)

Otherwise, the navigatorKey would not contain any state.

Collapse
 
pedromassango profile image
Pedro Massango

Thanks. Now I noticed that I made a typo