RoutePattern class

author:郑再红 email:1096877329@qq.com date:2026-04-29 17:20 describe: 路由模式匹配 路由模式类,用于匹配和解析路径参数

支持格式:

  • /user/:id - 匹配 /user/123,提取 {id: '123'}
  • /product/:category/:id - 匹配 /product/electronics/123
  • /posts/:year/:month/:day - 匹配 /posts/2024/01/15

Constructors

RoutePattern(String pattern)

Properties

hashCode int
The hash code for this object.
no setterinherited
paramNames List<String>
参数名称列表
final
pattern String
原始模式字符串
final
regex RegExp
编译后的正则表达式
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

match(String path) Map<String, String>?
匹配路径并提取参数
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