I can't really find much documentation on the router
package (assuming that's what you're using), and its GitHub repo is marked as "build failing" :/
There's another routing package called route
which is maintained by the Dart Authors, which I've use a little, and seems to work well. If you can't get router
to do what you need, I would definitely consider giving it a shot.
https://pub.dartlang.org/packages/route
main() {
var router = new Router()
..addHandler(new UrlPattern(r'/article/(\d+)'), showArticle)
..listen();
}
void showArticle(String path) {
var articleId = articleUrl.parse(req.path)[0];
// show article page with loading indicator
// load article from server, then render article
}