parse method
根据路径和方法解析出路由上下文
Parse the routing context based on the path and method.
The path
to be parsed.
eg:
router.handle('/some/:path/*subpathes', (RouterContext context) async {
print(context.routeId); // /some/:path/*subpathes
print(context.params['path']); // variables
print(context.params['subpathes']); // other/paths/for/this
print(context.queries['abc']); // def
print(context.queries[bcd]); // ["1", "2"]
print(context.middlewares); // []
});
RouterContext context = router.parse('/some/variables/other/paths/for/this?abc=def&bcd=1&bcd=2');
context.handler(context);
Implementation
RouterContext parse(String path, [String method = DEFAULT_METHOD]) {
return _routeTree.getContext(path, method);
}