Skip to main content
1

🚀 Pushes & Launches

push(Widget page)
Future<T?>
The preferred way to navigate. Pushes a new page and returns a Future that completes on pop.
await context.push(const ProfileScreen());
pushReplacement<T, TO>(Widget page)
Future<T?>
Replaces the current route with a new page. Ideal for post-login or checkout success screens.
context.pushReplacement(const HomeScreen());
pushNamed<T>(String routeName, {Object? arguments})
Future<T?>
Pushes a route defined by its string name onto the stack.
context.pushNamed('/settings', arguments: {'id': 123});
2

â†Šī¸ Pops & Returns

pop()
void
Pops the current route off the stack. (Aliased to popScreen for consistency).
IconButton(onPressed: context.pop, icon: Icon(Icons.close));
popScreen()
void
Pops the current route off the navigator stack (wrapper for Navigator.pop).
context.popScreen();
popUntilRoot()
void
Pops all routes until the very first (root) screen is reached. Great for clearing the stack after a successful flow.
context.popUntilRoot();