go_router Deep Linking in Flutter: Full Setup Guide
Learn go_router deep linking in Flutter from scratch: Android App Links, iOS Universal Links, auth redirect guards, ShellRoute bottom nav, and adb/xcrun testing.
Every app of any real size needs go_router deep linking in Flutter — links from emails, push notifications, and shared URLs that open the app directly on the right screen. It's one of those features that looks simple in a demo and then breaks in three places on real devices: the platform setup, the cold-start route, and the auth redirect loop. This tutorial wires all of it correctly: Android App Links, iOS Universal Links, path and query parameters, redirect auth guards with refreshListenable , a ShellRoute bottom navigation bar, and how to test deep links with adb and xcrun simctl so you can prove it works before shipping. What you'll learn How to add go_router and define declarative routes Android App Links setup ( assetlinks.json + manifest intent filters) iOS Universal Links setup (Associated Domains + AASA file) Reading path parameters, query parameters, and extra Auth guards with redirect and refreshListenable (and the redirect-loop gotcha) Bottom navigation with ShellRoute context.go() vs context.push() Testing deep links on Android and iOS emulators Step 1 — Add go_router On Flutter 3.x, add the package without any version pin — let the resolver pick a version compatible with your SDK: flutter pub add go_router Then build a minimal router in main.dart : import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; final _router = GoRouter( initialLocation: '/', routes: [ GoRoute( path: '/', builder: (context, state) => const HomeScreen(), ), GoRoute( path: '/product/:id', builder: (context, state) { final id = state.pathParameters['id']; return ProductScreen(productId: id ?? ''); }, ), ], ); void main() { runApp( MaterialApp.router( routerConfig: _router,…