leaf<P, S, D> method

RouteMatch<P, S, D> leaf<P, S, D>(
  1. TypedRoute<P, S, D> route
)

Returns the typed leaf match.

Implementation

RouteMatch<P, S, D> leaf<P, S, D>(TypedRoute<P, S, D> route) {
  final value = match(route);
  if (value == null ||
      !identical(_matches.last.route.identity, route.identity)) {
    throw StateError('The supplied route is not the leaf match.');
  }
  return value;
}