QueryParam<T extends Object> class
A read-only accessor for extracting typed query parameters.
Query parameters are the key-value pairs after ? in a URL.
Use this with QueryParameters to extract typed values.
Example:
const pageParam = QueryParam<int>('page', int.parse);
handler(req) {
final page = req.queryParameters.get(pageParam); // typed as int
return Response.ok();
}
- Inheritance
-
- Object
- ReadOnlyAccessor<
T, String, RawQueryParam> - QueryParam
Constructors
-
QueryParam(String key, Decoder<
T, RawQueryParam> decode) -
const
Properties
-
decode
→ Decoder<
T, RawQueryParam> -
Decodes the raw value into the typed value.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
The key used to identify this value in storage.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited