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:
- MutableRouteNode, used when guards and mutations modify the tree.
- Immutable instances from RouteNode.immutable or RouteNode.fromRoute for sealed snapshots of the current state.
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
routewith 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
truewhenotheris considered equal to this node under the suppliedequalitystrategy. -
find(
RouteNodePredicate< RouteNode> predicate, {bool recursive = true}) → RouteNode? -
Returns the first descendant (including
this) that satisfiespredicate, ornullwhen nothing matches.inherited -
findByRoute(
YxRoute route, {bool recursive = true}) → RouteNode? -
Returns the first descendant (including
this) whose route equalsroute, ornullwhen 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
actionto the givenrouteNodeand to each of itschildrenof typeN.inherited -
traverseChildren(
RouteNodeAction< RouteNode> action, {RouteNodePredicate<RouteNode> ? predicate, bool recursive = true}) → void -
Applies
actionto each direct child of the givenrouteNodeof typeN.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override