RouteNode class sealed

A node in the navigation tree.

A RouteNode pairs a YxRoute with serializable arguments, runtime-only extra data, and a list of children that represent nested stacks or sibling branches.

Two flavours exist:

Convert between them with RouteNode.toMutable and RouteNode.toImmutable.

Annotations

Constructors

RouteNode.fromRoute({required YxRoute route, Map<String, String> arguments = const {}, Map<String, Object?> extra = const {}, List<RouteNode> children = const []})
Creates an immutable node for route with optional arguments, extra data and children.
factory
RouteNode.immutable({required YxRoute route, required Map<String, String> arguments, required Map<String, Object?> extra, required List<RouteNode> children})
Creates an immutable node.
factory
RouteNode.mutable({required YxRoute route, required Map<String, String> arguments, required Map<String, Object?> extra, required List<RouteNode> children})
Creates a mutable node.
factory

Properties

arguments Map<String, String>
Serializable arguments associated with this node.
finalinherited
children Iterable<RouteNode>
Descendants or siblings of this node.
finalinherited
extra Map<String, Object?>
Runtime-only payload attached to this node.
finalinherited
hasArguments bool
Whether this node carries any arguments.
no setterinherited
hasChildren bool
Whether this node has any children.
no setterinherited
hasExtra bool
Whether this node carries any extra data.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
route YxRoute
The route that identifies this node in the navigation tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({YxRoute? route, Map<String, String>? arguments, Map<String, Object?>? extra, List<RouteNode>? children}) RouteNode
Returns a copy of this node with the given fields replaced.
inherited
equalsBy(RouteNode other, {Equality<RouteNode> equality = const RouteNodeEquality.deep()}) bool
Returns true when other is considered equal to this node under the supplied equality strategy.
find(RouteNodePredicate<RouteNode> predicate, {bool recursive = true}) RouteNode?
Returns the first descendant (including this) that satisfies predicate, or null when nothing matches.
inherited
findByRoute(YxRoute route, {bool recursive = true}) RouteNode?
Returns the first descendant (including this) whose route equals route, or null when nothing matches.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toImmutable() → ImmutableRouteNode
Returns an immutable copy of this node.
toMutable() MutableRouteNode
Returns a mutable copy of this node.
toString() String
A string representation of this object.
override
traverse(RouteNodeAction<RouteNode> action, {RouteNodePredicate<RouteNode>? predicate, bool recursive = true}) → void
Applies action to the given routeNode and to each of its children of type N.
inherited
traverseChildren(RouteNodeAction<RouteNode> action, {RouteNodePredicate<RouteNode>? predicate, bool recursive = true}) → void
Applies action to each direct child of the given routeNode of type N.
inherited

Operators

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