NavigationExtension extension

Navigation shortcuts for BuildContext.

on

Properties

canPop bool

Available on BuildContext, provided by the NavigationExtension extension

Whether the navigator can pop.
no setter
currentRouteName String?

Available on BuildContext, provided by the NavigationExtension extension

Name of the current route, or null if unnamed.
no setter

Methods

clearStackAndShow(Widget screen) → void

Available on BuildContext, provided by the NavigationExtension extension

Clear the entire navigation stack and show a new screen
maybePop() → void

Available on BuildContext, provided by the NavigationExtension extension

Pops if possible; otherwise does nothing.

Available on BuildContext, provided by the NavigationExtension extension

Pushes screen and removes every route below it.

Available on BuildContext, provided by the NavigationExtension extension

Pushes screen and runs onBack when it pops.

Available on BuildContext, provided by the NavigationExtension extension

Pops the current screen.

Available on BuildContext, provided by the NavigationExtension extension

Pushes screen; set fade for a fade transition. state is ignored (kept for backwards compatibility).

Available on BuildContext, provided by the NavigationExtension extension

Replaces the current screen with screen.
popToFirst() → void

Available on BuildContext, provided by the NavigationExtension extension

Pops until the first route on the stack.
popUntilRoute(String routeName) → void

Available on BuildContext, provided by the NavigationExtension extension

Pop until a specific route name
popWithResult<T>(T result) → void

Available on BuildContext, provided by the NavigationExtension extension

Pops the current route with a result.
pushScreen<T>(Widget screen) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Navigate to a new screen
pushWithFade<T>(Widget screen) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Push screen with fade transition
pushWithSlide<T>(Widget screen) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Push screen sliding in from the right.
replaceScreen<T>(Widget screen) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Replace the current screen
showAppDialog<T>({required Widget content, String? title, List<Widget>? actions, bool barrierDismissible = true}) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Shows a material AlertDialog with convenience params.
showSheet<T>(Widget child, {bool isScrollControlled = false}) Future<T?>

Available on BuildContext, provided by the NavigationExtension extension

Shows a modal bottom sheet.