last property

RouteMatch last

The last leaf route.

If the last RouteMatchBase from matches is a ShellRouteMatch, it recursively goes into its ShellRouteMatch.matches until it reach the leaf RouteMatch.

Throws a StateError if matches is empty.

Implementation

RouteMatch get last {
  if (matches.last is RouteMatch) {
    return matches.last as RouteMatch;
  }
  return (matches.last as ShellRouteMatch)._lastLeaf;
}