StackRouter class abstract
An implementation of a RoutingController that handles stack navigation
- Inheritance
-
- Object
- RoutingController
- StackRouter
- Implementers
Constructors
- StackRouter({required LocalKey key, RoutingController? parent, })
- Default constructor
Properties
- activeGuardObserver → ActiveGuardObserver
-
The active guards observer of this controller
latefinal
-
See
NavigationHistory.canNavigateBack
no setterinherited -
childControllers
→ List<
RoutingController> -
Holds track of the list of attached child controllers
no setterinherited
- current → RouteData
-
Returns currentChild if it's rendered
otherwise returns parent routeData
no setteroverride
- currentChild → RouteData?
-
The active child representation of an implementation of this controller
no setteroverride
- currentPath → String
-
Helper to access
NavigationHistory.urlState.path
no setterinherited -
currentSegments
→ List<
RouteMatch> -
Collects the top-most visitable current-child of
every top-most nested controller considering this controller as root
no setterinherited
- currentUrl → String
-
Helper to access
NavigationHistory.urlState.url
no setterinherited - hasEntries → bool
-
Whether this controller has rendered pages
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasPagelessTopRoute → bool
-
Whether the top-most route of this controller is page-less
no setter
- ignorePopCompleters ↔ bool
-
Whether AutoRoutePage should await for pop-completer
getter/setter pairinherited
- isRoot → bool
-
Whether is controller is the root of all controllers
no setterinherited
- isTopMost → bool
-
Whether this controller has the top-most visible page
no setterinherited
- key → LocalKey
-
The Identifier key of this routing controller
final
- managedByWidget → bool
-
Whether is router is used by a declarative-routing widget
no setterinherited
- matcher → RouteMatcher
-
The matcher used by this controller
see
RouteMatcher
no setteroverride -
The instance of
NavigationHistory
to be used by this routerno setterinherited -
Navigator key passed to Navigator.key
no setter
- pageBuilder → PageBuilder
-
The builder used to build routable pages
no setteroverride
- pageCount → int
-
The count of rendered pages
no setterinherited
- pagelessRoutesObserver → PagelessRoutesObserver
-
The page-less route observer of this controller
final
- parentAsStackRouter → StackRouter?
-
Returns parent route as StackRouter
no setterinherited
- pathState → Object?
-
See
NavigationHistory.pathState
no setterinherited - pendingRoutesHandler → PendingRoutesHandler
-
The pending routes handler for this controller
latefinal
- root → RootStackRouter
-
Returns the root router as RootStackRouter
no setterinherited
- routeCollection → RouteCollection
-
The list of routes consumed by this controller
no setteroverride
- routeData → RouteData
-
The data of the parent route
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stack
→ List<
AutoRoutePage> -
The current pages stack of this controller
no setteroverride
-
stackData
→ List<
RouteData> -
Returns an unmodifiable lis of current pages stack data
no setterinherited
- stateHash → int
-
Takes a state snapshot of the current segments
no setteroverride
- topMatch → RouteMatch
-
The top-most rendered or pending route match
no setterinherited
- topPage → AutoRoutePage?
-
The top-most visible page
no setterinherited
- topRoute → RouteData
-
The top-most rendered route
no setteroverride
- urlState → UrlState
-
Helper to access
NavigationHistory.urlState
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
attachChildController(
RoutingController childController) → void -
Adds the given controller to the list of childControllers
inherited
-
back(
) → void -
See
NavigationHistory.back
inherited -
buildPageRoute(
String? path, {bool includePrefixMatches = true}) → PageRouteInfo? -
Finds match of
path
then returns a route-able entityinherited -
buildPageRoutesStack(
String? path, {bool includePrefixMatches = true}) → List< PageRouteInfo> ? -
Finds matches of
path
then returns a list of route-able entitiesinherited -
canPop(
{bool ignoreChildRoutes = false, bool ignoreParentRoutes = false, bool ignorePagelessRoutes = false}) → bool -
Whether this controller can preform pop
override
-
currentHierarchy(
{bool asPath = false, bool ignorePending = false, bool ignoreParams = false}) → List< HierarchySegment> -
Builds a simplified hierarchy of current stacks
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
innerRouterOf<
T extends RoutingController> (String routeName) → T? -
Finds a child route corresponding to
routeName
and casts it toT
inherited -
isPathActive(
String path) → bool -
See
NavigationHistory.isPathActive
inherited -
isRouteActive(
String routeName) → bool -
See
NavigationHistory.isRouteActive
inherited -
isRouteDataActive(
RouteData data) → bool -
See
NavigationHistory.isRouteDataActive
inherited -
markUrlStateForReplace(
) → void -
See
NavigationHistory.markUrlStateForReplace
inherited -
match(
PageRouteInfo route) → RouteMatch? -
Helper to find route match
See
RouteMatcher.matchByRoute
inherited -
Pops until given
route
, if it already exists in stack otherwise adds it to the stack (good for web Apps and to avoid duplicate entries).inherited -
Preforms pop-until finds cosponsoring route with
routes
.first then pushes allroutes
-
See
NavigationHistory.back
inherited -
Pops until given
path
, if it already exists in stack otherwise adds it to the stackinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyAll(
{bool forceUrlRebuild = false}) → void -
Notify this controller for changes then notify root controller
if they're not the same
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
parent<
T extends RoutingController> () → T? -
Casts parent controller to
T
inherited -
pop<
T extends Object?> ([T? result]) → Future< bool> -
Clients can either pop their own
_pages
stack or defer the call to a parent controlleroverride -
popAndPush<
T extends Object?, TO extends Object?> (PageRouteInfo route, {TO? result, OnNavigationFailure? onFailure}) → Future< T?> -
Pop the current route off the navigator and push the given
route
in its place. -
popAndPushAll(
List< PageRouteInfo> routes, {dynamic onFailure}) → Future<void> -
Pop the current route off the navigator and push all given
routes
in its place. -
popForced<
T extends Object?> ([T? result]) → void - Pop current route regardless if it's the last route in stack or the result of it's willPopScopes see Navigator.pop
-
popTop<
T extends Object?> ([T? result]) → Future< bool> -
Calls pop on the controller with the top-most visible page
inherited
-
popUntil(
RoutePredicate predicate) → void - Calls pop repeatedly on the navigator until the predicate returns true.
-
popUntilRoot(
) → void - Pop the whole stack except for the first entry
-
popUntilRouteWithName(
String name) → void -
Helper to pop all routes until route with
name
is found see popUntil -
popUntilRouteWithPath(
String path) → void -
Helper to pop all routes until route with
path
is found see popUntil -
push<
T extends Object?> (PageRouteInfo route, {OnNavigationFailure? onFailure}) → Future< T?> -
Adds the corresponding page to given
route
to the_pages
stack -
pushAll(
List< PageRouteInfo> routes, {OnNavigationFailure? onFailure}) → Future<void> -
Adds the corresponding pages to given
routes
list to the_pages
stack at once -
pushAndPopUntil<
T extends Object?> (PageRouteInfo route, {required RoutePredicate predicate, OnNavigationFailure? onFailure}) → Future< T?> -
Push the given
route
onto the navigator, and then pop all the previous routes until thepredicate
returns true. -
pushNamed<
T extends Object?> (String path, {bool includePrefixMatches = false, OnNavigationFailure? onFailure}) → Future< T?> -
Adds corresponding page to given
path
to_pages
stack -
pushNativeRoute<
T extends Object?> (Route< T> route) → Future<T?> - Pushes a Route to Navigator
-
pushPathState(
Object? state) → void -
See
NavigationHistory.pushPathState
inherited -
pushWidget<
T extends Object?> (Widget widget, {RouteTransitionsBuilder? transitionBuilder, bool fullscreenDialog = false, Duration transitionDuration = const Duration(milliseconds: 300)}) → Future< T?> - Pushes a raw widget to Navigator
-
removeChildController(
RoutingController childController) → void -
removes the given controller from the list of childControllers
inherited
-
removeLast(
) → bool -
Removes the very last entry from
_pages
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeRoute(
RouteData route, {bool notify = true}) → void -
Removes given
route
and any corresponding controllers or redirect-guards -
removeUntil(
RouteDataPredicate predicate) → bool - Calls removeRoute repeatedly until the predicate returns true.
-
removeWhere(
RouteDataPredicate predicate, {bool notify = true}) → bool -
Removes any route that satisfied the
predicate
. -
replace<
T extends Object?> (PageRouteInfo route, {OnNavigationFailure? onFailure}) → Future< T?> -
Removes last entry in stack and pushes given
route
if last entry ==route
page will just be updated -
replaceAll(
List< PageRouteInfo> routes, {OnNavigationFailure? onFailure}) → Future<void> -
Remove the whole current pages stack and push all given
routes
-
replaceNamed<
T extends Object?> (String path, {bool includePrefixMatches = false, OnNavigationFailure? onFailure}) → Future< T?> -
Removes last entry in stack and pushes given
path
if last entry.path ==path
page will just be updated -
topMostRouter(
{bool ignorePagelessRoutes = false}) → RoutingController -
Finds the router with top-most visible page
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateDeclarativeRoutes(
List< PageRouteInfo> routes) → void -
Replaces the list of
_pages
with givenroutes
result used by declarative routing widgets -
updateRouteData(
RouteData data) → void -
Updates the value of routeData
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited