PathExtractable<T> class
final
Extracts one router-captured path parameter, coerced to T.
@Path() String id lowers to const PathExtractable<String>('id'); the key
defaults to the Dart parameter name and @Path('todo_id') overrides it.
The matcher captures the raw segment, so decoding happens here:
/files/a%20b gives a b, not a%20b.
The value arrives percent-decoded, so it can contain a slash, a NUL, or any other character a client chose to encode:
/files/a%2Fbmatches one segment and yieldsa/b. That is what the value is, per RFC 3986. Treat it as untrusted text — never as a path fragment — or constrain it at the route with{name|pattern}, which refuses before a handler runs.
- Implemented types
- Available extensions
Constructors
- PathExtractable(String key)
-
Reads the path parameter named
key.const
Properties
Methods
-
extract(
Request request) → Future< Result< T, Rejection> > -
Produces the value, or the rejection that stops the handler.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
require(
Request request) → Future< T> -
Available on FromRequestParts<
Extracts the value, throwing the Rejection when extraction fails.T> , provided by the RequireExtraction extension -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited