KaiselNavigator class abstract

Non-generic view of a KaiselRouter's navigation primitives.

Lets containers like BranchedShellRouter aggregate heterogeneously typed routers (e.g. KaiselRouter<HomeRoute> and KaiselRouter<DiscoverRoute>) under a single list without losing the non-typed operations they need (can-pop and pop on the active branch for back-button handling, plus type-erased stack capture/restore for URL round-trips in v0.5+). The typed router still does what it does; this is just the slice that's safe to call without knowing R.

Implemented types
Implementers

Constructors

KaiselNavigator()

Properties

canPop bool
Whether pop would actually remove a route from this router.
no setter
debugAbsorbedPositions Set<int>
Stack positions absorbed by adaptive rendering, for DevTools. Empty for non-adaptive routers. See KaiselRouter.debugAbsorbedPositions.
no setter
debugLastNoOp KaiselNoOp?
The most recent no-op navigation on this router, for DevTools. Debug only; null in release. See KaiselRouter.debugLastNoOp.
no setter
debugLastTransitionOrigin StackTrace?
The call site that issued this router's most recent committed navigation, for DevTools. Debug only; null in release (and for changes with no app call site, e.g. a system-back pop).
no setter
debugLastTransitionSeq int
A monotonic stamp paired with debugLastTransitionOrigin, so a host can tell which router transitioned most recently. Debug only; 0 in release.
no setter
hashCode int
The hash code for this object.
no setterinherited
replacesHistoryEntry bool
Whether this router's most recent committed change should overwrite the browser history entry (replaceTop / set) rather than add one (push). A shell container reads it from its active branch so a nested replace is reported as a replace too. See KaiselRouter.replacesHistoryEntry.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stack List<KaiselRoute>
The router's current stack, type-erased to KaiselRoute. The typed KaiselRouter<R>.stack returns the same data as List<R>; this is the view shell containers see.
no setter

Methods

addListener(void listener()) → void
Register listener to be called on every change notification.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop() Future<bool>
Pop the top route from this router. Returns false if the router was already at root.
removeListener(void listener()) → void
Remove a previously registered listener. Idempotent.
inherited
restoreStack(List<KaiselRoute> stack) Future<void>
Replace this router's stack from a (type-erased) list of routes. Throws ArgumentError if any element is not assignable to this router's underlying R. Used by KaiselRouterDelegate when restoring shell state from a URL.
toString() String
A string representation of this object.
inherited

Operators

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