Feb 3, 2021
Navigator.of(context, rootNavigator: true).pushReplacement(
MaterialPageRoute(
builder: (context) => LoginScreen(),
),
);
I'll answer this myself: just use the rootNavigator attribute to get the original navigator, and it works.
Navigator.of(context, rootNavigator: true).pushReplacement(
MaterialPageRoute(
builder: (context) => LoginScreen(),
),
);
I'll answer this myself: just use the rootNavigator attribute to get the original navigator, and it works.
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app
I'm a Computer Engineer, designer and Android developer. My works are mainly themes, icons, wallpapers and animations.