createStack method

RouteNode<RouteValue>? createStack({
  1. RouteNode<RouteValue>? next,
  2. required Map<Object, RouteValue> values,
})

Creates a stack of RouteNodes from this route to the root.

Implementation

RouteNode? createStack({
  RouteNode? next,
  required Map<Object, RouteValue> values,
}) {
  final node = createNode(
    next: next,
    value: values[key] as T?,
  );

  if (parent case final parent?) {
    return parent.createStack(
      next: node,
      values: values,
    );
  } else {
    return node;
  }
}