TabsRouter class

An implementation of a RoutingController that handles parallel routeing

aka Tab-Routing

Inheritance

Constructors

TabsRouter({required RouteCollection routeCollection, required PageBuilder pageBuilder, required LocalKey key, required RouteData routeData, int homeIndex = -1, required bool preload(int index), RoutingController? parent})
Default constructor

Properties

activeIndex int
The index of active page
no setter
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 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
homeIndex int
The index to pop from
final
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 setteroverride
matcher → RouteMatcher
The matcher used by this controller see RouteMatcher
final
The instance of NavigationHistory to be used by this router
no setterinherited
pageBuilder PageBuilder
The builder used to build routable pages
final
pageCount int
The count of rendered pages
no setterinherited
parentAsStackRouter StackRouter?
Returns parent route as StackRouter
no setterinherited
pathState Object?
See NavigationHistory.pathState
no setterinherited
preload bool Function(int index)
Called to preload a page before other navigation events occur if it returns true, the page has been preloaded, otherwise we assume it's already loaded
getter/setter pair
previousIndex int?
The index of previous active page
no setter
root RootStackRouter
Returns the root router as RootStackRouter
no setterinherited
routeCollection RouteCollection
The list of routes consumed by this controller
final
routeData RouteData
The data of the parent route
no setteroverride
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 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
override
childrenCanPop({bool ignorePagelessRoutes = false}) bool
returns true if any child controller can pop
inherited
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).
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
override
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
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
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 controller
inherited
popTop<T extends Object?>([T? result]) Future<bool>
Calls maybePop on the controller with the top-most visible page
inherited
pushPathState(Object? state) → void
See NavigationHistory.pushPathState
inherited
removeChildController(RoutingController childController) → void
removes the given controller from the list of childControllers
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
replaceAll(List<PageRouteInfo>? routes, int previousIndex) → void
Resets _pages stack with given routes and sets previousActiveRoute as active index if provided
setActiveIndex(int index, {bool notify = true}) → void
Updates _activeIndex and triggers a rebuild
setupRoutes(List<PageRouteInfo>? routes) → void
Pushes given routes to _pages stack after match validation and deciding initial index
stackRouterOfIndex(int index) StackRouter?
If page corresponding with index has an attached StackRouter returns it otherwise returns null
topMostRouter({bool ignorePagelessRoutes = false}) RoutingController
Finds the router with top-most visible page
inherited
toString() String
A string representation of this object.
inherited
updateRouteData(RouteData data) → void
Updates the value of routeData
override

Operators

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