QuickRouters extension

An extension that provides some handy methods for navigating between routes using the Navigator widget. It supports both regular and restorable routes, as well as different transition types.

on

Methods

back<T extends Object?>([T? result]) → void

Available on BuildContext, provided by the QuickRouters extension

A method that pops the current route and returns an optional result to the previous route.
canPop() bool

Available on BuildContext, provided by the QuickRouters extension

A method that returns true if the Navigator can pop the current route.
maybePop<T extends Object?>([T? result]) Future<bool>

Available on BuildContext, provided by the QuickRouters extension

A method that tries to pop the current route and returns a future that completes with true if the pop succeeded, and false otherwise. It also returns an optional result to the previous route.
popUntil(bool predicate(Route route)) → void

Available on BuildContext, provided by the QuickRouters extension

A method that pops all the routes until the predicate is satisfied.
pushAndRemoveUntil<T extends Object?>(Widget child, RoutePredicate predicate, {QuickTransition? transitions}) Future<T?>

Available on BuildContext, provided by the QuickRouters extension

A method that pushes a new route to the Navigator with the given child widget and transition type, and removes all the previous routes until the predicate is satisfied.
pushReplacement<T extends Object?, TO extends Object?>(Widget child, {QuickTransition? transitions, TO? result}) Future<T?>

Available on BuildContext, provided by the QuickRouters extension

A method that pushes a new route to the Navigator with the given child widget and transition type, and replaces the current route with the new one. It also returns an optional result to the previous route.
removeRoute(Route route) → void

Available on BuildContext, provided by the QuickRouters extension

A method that removes the given route from the Navigator.
removeRouteBelow(Route anchorRoute) → void

Available on BuildContext, provided by the QuickRouters extension

A method that removes the route below the given one from the Navigator.
replace<T extends Object?>({required Widget old, required Widget to, QuickTransition? transitions}) → void

Available on BuildContext, provided by the QuickRouters extension

A method that replaces the current route with a new one with the given child widget and transition type. It also preserves the type parameter of the current route.
replaceRouteBelow<T extends Object?>({required Widget anchor, required Widget to, QuickTransition? transitions}) → void

Available on BuildContext, provided by the QuickRouters extension

A method that replaces the route below the current one with a new one with the given child widget and transition type. It also preserves the type parameter of the route below the current one.
restorablePushAndRemoveUntil<T extends Object?>(RestorableRouteBuilder<T> newRouteBuilder, RoutePredicate predicate, {Object? arguments}) String

Available on BuildContext, provided by the QuickRouters extension

A method that pushes a new restorable route to the Navigator with the given route builder and arguments, and removes all the previous routes until the predicate is satisfied. It returns a restoration ID that can be used to restore the state of the route.
restorableReplace<T extends Object?>({required Widget old, required RestorableRouteBuilder<T> to, QuickTransition? transitions, Object? arguments}) String

Available on BuildContext, provided by the QuickRouters extension

A method that replaces the current route with a new restorable route with the given route builder and arguments. It also preserves the type parameter of the current route and returns a restoration ID that can be used to restore the state of the route.
restorableReplaceRouteBelow<T extends Object?>({required Widget anchor, required RestorableRouteBuilder<T> newRouteBuilder, Object? arguments, QuickTransition? transitions}) String

Available on BuildContext, provided by the QuickRouters extension

A method that replaces the route below the current one with a new restorable route with the given route builder and arguments. It also preserves the type parameter of the route below the current one and returns a restoration ID that can be used to restore the state of the route.
to<T extends Object?>(Widget child, {QuickTransition? transitions}) Future<T?>

Available on BuildContext, provided by the QuickRouters extension

A method that pushes a new route to the Navigator with the given child widget and transition type. Defines the available transition options for animations. Only one transition can be selected at a time.