RouteParams class

路由参数辅助类 用于从 RouteInformation 的 state 中提取参数 Parsed route metadata stored in RouteInformation.state.

Constructors

RouteParams({required String path, Map<String, String>? pathParams, Map<String, String>? queryParams, String? matchedPattern, String? originalUri})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
matchedPattern String?
final
originalUri String?
final
path String
final
pathParams Map<String, String>?
final
queryParams Map<String, String>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAllParams() Map<String, String>
获取所有参数(路径参数 + 查询参数) Returns both path and query parameters in a single map.
getPathParam(String key) String?
获取路径参数 Returns a path parameter by key.
getQueryParam(String key) String?
获取查询参数 Returns a query parameter by key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromState(Object? state) RouteParams?
从 RouteInformation 的 state 中提取参数 Creates an instance from RouteInformation.state.