📚 Encyclopedia

Flutter & Mobile · updated 2026-10-13

go_router navigation patterns and opening your own links in-app

fluttergo_routerdeep-linksnavigationflutter-weburl

Notes from the TLDR app on go_router: when to go versus push, how to make absolute links to your own site open inside the app by asking the live router, and how routes for logged-out viewers and email links fit in.

go vs push

Opening your own URLs in the app

Markdown and linkified text produce absolute links like https://tldrnerd.com/posts/1608 (that is what the share button copies). Before v1.52.2 these opened a browser tab. The fix is one tap handler used everywhere links are tappable:

void openLink(BuildContext context, String href) {
  // relative "/..." -> context.go
  // app-host URL -> internal path, if the live router can match it -> context.go
  // any other http(s) -> openUrlExternal
}

Routes for people who are not logged in

A public read-only page (/s/:token) must sit outside the ShellRoute and short-circuit the login redirect, and its screen must not use any widget that assumes a session (avatars, mention linkifying, authenticated tiles).

See also

Linked from

Sources: tldr memory (feature-in-app-links, completed-work, server-web-performance, feature-public-share-links), post #1650