RootStackRouter class abstract

An Implementation of StackRouter used by AutoRouterDelegate

Inheritance

Constructors

RootStackRouter({GlobalKey<NavigatorState>? navigatorKey})
Default constructor

Properties

activeGuardObserver ActiveGuardObserver
The active guards observer of this controller
finalinherited
canNavigateBack bool
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 setterinherited
currentChild RouteData?
The active child representation of an implementation of this controller
no setterinherited
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
defaultRouteType RouteType
The default animation
no setter
guards List<AutoRouteGuard>
A List of Root router guards
no setter
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 setterinherited
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
finalinherited
managedByWidget bool
Whether is router is used by a declarative-routing widget
no setteroverride
matcher → RouteMatcher
The matcher used by this controller see RouteMatcher
latefinal
The instance of NavigationHistory to be used by this router
no setteroverride
Navigator key passed to Navigator.key
no setterinherited
pageCount int
The count of rendered pages
no setterinherited
pagelessRoutesObserver PagelessRoutesObserver
The page-less route observer of this controller
finalinherited
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
latefinalinherited
root RootStackRouter
Returns the root router as RootStackRouter
no setterinherited
routeCollection RouteCollection
The list of routes consumed by this controller
latefinal
routeData RouteData
The data of the parent route
no setteroverride
routes List<AutoRoute>
The list of route entries to match against
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stack List<AutoRoutePage>
The current pages stack of this controller
no setterinherited
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 setterinherited
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 setterinherited
urlState UrlState
Helper to access NavigationHistory.urlState
no setterinherited

Methods

activeRouterCanPop({bool ignorePagelessRoutes = false}) bool
returns true if the active child controller can pop
inherited
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 entity
inherited
buildPageRoutesStack(String? path, {bool includePrefixMatches = true}) List<PageRouteInfo>?
Finds matches of path then returns a list of route-able entities
inherited
canPop({bool ignoreChildRoutes = false, bool ignoreParentRoutes = false, bool ignorePagelessRoutes = false}) bool
Whether this controller can preform maybePop
inherited
childrenCanPop({bool ignorePagelessRoutes = false}) bool
returns true if any child controller can pop
inherited
config({DeepLinkTransformer? deepLinkTransformer, DeepLinkBuilder? deepLinkBuilder, String? navRestorationScopeId, WidgetBuilder? placeholder, NavigatorObserversBuilder navigatorObservers = AutoRouterDelegate.defaultNavigatorObserversBuilder, bool includePrefixMatches = !kIsWeb, bool neglectWhen(String? location)?, bool rebuildStackOnDeepLink = false, Listenable? reevaluateListenable}) RouterConfig<UrlState>
Returns a RouterConfig instead to be passed to MaterialApp.router
currentHierarchy({bool asPath = false, bool ignorePending = false, bool ignoreParams = false}) List<HierarchySegment>
Builds a simplified hierarchy of current stacks
inherited
defaultRouteParser({bool includePrefixMatches = !kIsWeb, DeepLinkTransformer? deepLinkTransformer}) DefaultRouteParser
Builds a lazy instance of DefaultRouteParser
delegate({String? navRestorationScopeId, WidgetBuilder? placeholder, NavigatorObserversBuilder navigatorObservers = AutoRouterDelegate.defaultNavigatorObserversBuilder, DeepLinkBuilder? deepLinkBuilder, bool rebuildStackOnDeepLink = false, Listenable? reevaluateListenable}) AutoRouterDelegate
Builds a lazy instance of AutoRouterDelegate _lazyRootDelegate is only built one time
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).
inherited
innerRouterOf<T extends RoutingController>(String routeName) → T?
Finds a child route corresponding to routeName and casts it to T
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
maybePop<T extends Object?>([T? result]) Future<bool>
Clients can either pop their own _pages stack or defer the call to a parent controller
inherited
maybePopTop<T extends Object?>([T? result]) Future<bool>
Calls maybePop on the controller with the top-most visible page
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 all routes
inherited
Pops until given path, if it already exists in stack otherwise adds it to the stack
inherited
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
onPopPage(Route route, RouteData data) → void
Called when Page route is popped this is not called when pageless routes are popped e.g popping a dialog that does not use PageRoute will not trigger this method
inherited
parent<T extends RoutingController>() → T?
Casts parent controller to T
inherited
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.
inherited
popAndPushAll(List<PageRouteInfo> routes, {dynamic onFailure}) Future<void>
Pop the current route off the navigator and push all given routes in its place.
inherited
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
inherited
popUntil(RoutePredicate predicate, {bool scoped = true}) → void
Calls maybePop repeatedly on the navigator until the predicate returns true.
inherited
popUntilRoot() → void
Pop the whole stack except for the first entry
inherited
popUntilRouteWithName(String name, {bool scoped = true}) → void
Helper to pop all routes until route with name is found see popUntil
inherited
popUntilRouteWithPath(String path, {bool scoped = true}) → void
Helper to pop all routes until route with path is found see popUntil
inherited
push<T extends Object?>(PageRouteInfo route, {OnNavigationFailure? onFailure}) Future<T?>
Adds the corresponding page to given route to the _pages stack
inherited
pushAll(List<PageRouteInfo> routes, {OnNavigationFailure? onFailure}) Future<void>
Adds the corresponding pages to given routes list to the _pages stack at once
inherited
pushAndPopUntil<T extends Object?>(PageRouteInfo route, {required RoutePredicate predicate, bool scopedPopUntil = true, OnNavigationFailure? onFailure}) Future<T?>
Push the given route onto the navigator, and then maybePop all the previous routes until the predicate returns true.
inherited
pushNamed<T extends Object?>(String path, {bool includePrefixMatches = false, OnNavigationFailure? onFailure}) Future<T?>
Adds corresponding page to given path to _pages stack
inherited
pushNativeRoute<T extends Object?>(Route<T> route) Future<T?>
Pushes a Route to Navigator
inherited
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), bool opaque = true}) Future<T?>
Pushes a raw widget to Navigator
inherited
reevaluateGuards() Future<void>
Re-builds all routes in stack and reevaluate guarded once by re-visiting the onNavigation method when evaluation logic changes
inherited
removeChildController(RoutingController childController) → void
removes the given controller from the list of childControllers
inherited
removeLast() bool
Removes the very last entry from _pages
inherited
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
inherited
removeUntil(RouteDataPredicate predicate, {bool scoped = true}) bool
Calls removeRoute repeatedly until the predicate returns true.
inherited
removeWhere(RouteDataPredicate predicate, {bool notify = true}) bool
Removes any route that satisfied the predicate.
inherited
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
inherited
replaceAll(List<PageRouteInfo> routes, {OnNavigationFailure? onFailure, bool updateExistingRoutes = true}) Future<void>
Remove the whole current pages stack and push all given routes
inherited
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
inherited
routeInfoProvider({RouteInformation? initialRouteInformation, bool neglectWhen(String? location)?}) AutoRouteInformationProvider
Builds a lazy instance of AutoRouteInformationProvider
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 given routes result used by declarative routing widgets
inherited
updateRouteData(RouteData data) → void
Updates the value of routeData
override

Operators

operator ==(Object other) bool
The equality operator.
inherited