flutter-setup-declarative-routing

Configure declarative routing and deep linking in Flutter apps using go_router.

Updated Jul 23, 2025
One-click install
npx skills add https://github.com/derrik-fleming/dotfiles --skill flutter-setup-declarative-routing-derrik-fleming
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-setup-declarative-routing
Source: https://github.com/derrik-fleming/dotfiles/tree/main/private_dot_agents/skills/flutter-setup-declarative-routing
Command: npx skills add https://github.com/derrik-fleming/dotfiles --skill flutter-setup-declarative-routing-derrik-fleming

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go_router.

What problem does it solve? Setting up URL-based navigation, deep linking, and nested navigation in Flutter requires coordinating Dart router configuration with platform-specific Android and iOS settings, which is error-prone when done manually. ## Core Features & Use Cases - Declarative Router Setup: Initialize a GoRouter with route trees, path parameters, redirects, and error handling bound to MaterialApp.router. - Platform Deep Linking: Configure Android App Links (manifest intent filters plus assetlinks.json) and iOS Universal Links (entitlements plus apple-app-site-association) with ADB and simctl validation commands. - Nested Navigation: Implement StatefulShellRoute with persistent bottom navigation bars that preserve per-branch state. - Use Case: You are building a Flutter web and mobile app that must open https://yourdomain.com/details/123 directly into a details screen while keeping a bottom navigation bar with independent tab state. ## Quick Start Set up go_router in my Flutter app with deep linking for both Android and iOS and a bottom navigation shell.

Frequently Asked Questions about flutter-setup-declarative-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up go_router in a Flutter app?▼

Add go_router with flutter pub add, define a top-level GoRouter with your route tree, and pass it to MaterialApp.router via routerConfig. Call usePathUrlStrategy in main to remove the hash fragment from web URLs.

How to enable deep linking in Flutter for Android and iOS?▼

On Android, add an intent filter with autoVerify in AndroidManifest.xml and host assetlinks.json at your domain's .well-known path. On iOS, enable FlutterDeepLinkingEnabled, add associated domains to Runner.entitlements, and host the apple-app-site-association file.

Does go_router support nested navigation with a bottom navigation bar?▼

Yes, go_router supports nested navigation through StatefulShellRoute.indexedStack, which wraps child routes in a persistent shell like a bottom navigation bar. Each StatefulShellBranch maintains its own independent navigation state.

How do I test deep links on Android and iOS simulators?▼

On Android, use adb shell with am start and a VIEW intent targeting your URL and package name. On iOS, run xcrun simctl openurl booted followed by the deep link URL on a booted simulator.

Why is my Flutter deep link not opening the app?▼

Common causes include a missing or mis-signed assetlinks.json fingerprint on Android, incorrect associated domains on iOS, or FlutterDeepLinkingEnabled conflicting with a third-party plugin like app_links. Verify the hosted association files and set FlutterDeepLinkingEnabled to NO when using external plugins.