IndexedStackPath<T extends RouteTarget> class
A fixed stack path for indexed navigation (like tabs).
Routes are pre-defined and cannot be added or removed. Navigation switches the active index.
Role in Navigation Flow
IndexedStackPath manages tab-based navigation:
- Routes are defined upfront in a fixed list
- Navigation switches the active index rather than stack
- Renders content via IndexedStackPathBuilder widget
- Implements RestorablePath for tab index restoration
When navigating:
- goToIndexed switches to a different route by index
- activateRoute activates a route already in the stack
- Routes cannot be pushed or popped, only activated
- Inheritance
- Mixed-in types
- Implementers
- Available extensions
Constructors
-
IndexedStackPath.create(List<
T> stack, {String? label, Coordinator<RouteUnique> ? coordinator}) -
Creates an IndexedStackPath with a fixed list of routes.
factory
-
IndexedStackPath.createWith(List<
T> stack, {required Coordinator<RouteUnique> coordinator, required String label}) -
Creates an IndexedStackPath associated with a Coordinator.
factory
Properties
- activeIndex → int
-
The index of the currently active path in the stack.
no setter
- activeRoute → T
-
The currently active route in this stack.
no setteroverride
-
coordinator
→ CoordinatorCore<
RouteUri> ? -
The coordinator this path belongs to.
no setterinherited
- debugLabel → String?
-
A label for debugging purposes.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- pathKey → PathKey
-
IndexedStackPath key. This is used to identify this type in
defineLayoutBuilder.no setteroverride -
proxyCoordinator
→ CoordinatorCore<
RouteUri> ? -
The proxy coordinator for this path.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stack
→ List<
T> -
The current navigation stack as an unmodifiable list.
no setterinherited
Methods
-
activateRoute(
T route) → Future< void> -
Activates a specific route in the stack.
override
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
bindLayout(
RouteLayoutConstructor< RouteUnique> constructor) → void -
Available on StackPath<
T> , provided by the RouteLayoutBinding extension -
bindStack(
List< T> stack) → void -
inherited
-
clear(
) → void -
Clears all routes from this path.
inherited
-
deserialize(
int data) → int -
Deserializes previously saved navigation state back into route objects.
override
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
goToIndexed(
int index) → Future< void> -
Switches the active route to the one at
index. -
Navigates to a specific route, adjusting the stack accordingly.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void -
Reset stack of this path.
override
-
restore(
int data) → void -
Restores the navigation state from deserialized data.
override
-
serialize(
) → int -
Serializes the current navigation state into a persistable format.
override
-
toFlutterListenable(
) → Listenable -
Available on ListenableMixin, provided by the ListenableMixinToFlutterListenable extension
Wraps this mixin as a Flutter flutter.Listenable for ListenableBuilder / AnimatedBuilder. -
toListenableMixin(
) → ListenableMixin -
Available on Listenable, provided by the ListenableToListenableMixin extension
Wraps this listenable as a ListenableMixin for RouteGuard.canPopListenable. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited