createFromUrl method

  1. @override
RouteNode<RouteValue>? createFromUrl(
  1. UrlData url
)
override

Receives a list of url segments and returns the stack parsed from them. The first segment in the list is matched against this route. If it does not correspond to this route, returns null.

A segment is a part of the url separated by slashes ('/'). The slashes are not included into the segment.

Implementation

@override
RouteNode<RouteValue>? createFromUrl(UrlData url) {
  final next = HyperRoute.matchUrl(url: url, routes: children);

  if (next == null) {
    return null;
  }

  return createNode(
    next: next,
  );
}