matchedPath property

NormalizedPath get matchedPath

The portion of the request path that was matched by the route.

For example, if the route pattern is /api/** and the request is to /api/users/123, this returns /api. For exact matches, this is the entire path.

This replaces the deprecated handlerPath property from earlier versions.

Returns NormalizedPath.empty if the request was not routed through a router.

Implementation

NormalizedPath get matchedPath =>
    _routingContext[this]?.matched ?? NormalizedPath.empty;