flutter avatar

Flutter Setup Declarative Routing

Skip the hand-rolled Navigator 2.0 boilerplate and use `go_router`. This skill walks through the full setup: adding the package, calling `usePathUrlStrategy()` to drop the `#` from web URLs, defining a route tree with path parameters like `details/:id`, and binding it to `MaterialApp.router`. The more useful parts are the platform sections, which cover the AndroidManifest intent filter plus `assetlinks.json` and the iOS entitlements plus `apple-app-site-association`, along with `adb` and `xcrun simctl` commands to test deep links without shipping. It also shows `StatefulShellRoute.indexedStack` for bottom-nav tabs that keep their state. Reach for it when you need real deep links or browser history on web. For a simple app with a few screens and no URL requirements, it's more machinery than you need.

skills.sh installs
39.7K
GitHub stars
3.2K
last updated
Oct 26, 2026

Install

$ npx -y skills add flutter/agent-plugins --skill flutter-setup-declarative-routing --agent claude-code

Installs into .claude/skills of the current project.

Files

Implementing Routing and Deep Linking

Contents

Core Concepts

Use the go_router package for declarative routing in Flutter. It provides a robust API for complex routing scenarios, deep linking, and nested navigation.

  • GoRouter: The central configuration object defining the application's route tree.
  • GoRoute: A standard route mapping a URL path to a Flutter screen.
  • ShellRoute / StatefulShellRoute: Wraps child routes in a persistent UI shell (e.g., a BottomNavigationBar). StatefulShellRoute maintains the state of parallel navigation branches.
  • Path URL Strategy: Removes the default # fragment from web URLs, essential for clean deep linking across platforms.

Workflow: Initializing the Application and Router

Sponsors

Details

Repository
github.com/flutter/agent-plugins
Categories
AI & Agent Building, Automation & Workflows, Mobile Development
First seen
Oct 26, 2026

More from flutter/agent-plugins

All 10
1flutter avatarflutter-implement-json-serializationflutter/agent-pluginsCreate model classes with `fromJson` and `toJson` methods using `dart:convert`. Use when manually mapping JSON keys to class properties for simple data structur39.4Kskills.sh installs
2flutter avatarflutter-add-widget-previewflutter/agent-pluginsAdds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure consi38.7Kskills.sh installs
3flutter avatarflutter-setup-localizationflutter/agent-pluginsAdd `flutter_localizations` and `intl` dependencies, enable "generate true" in `pubspec.yaml`, and create an `l10n.yaml` configuration file. Use when initializi38.7Kskills.sh installs
4flutter avatarflutter-use-http-packageflutter/agent-pluginsUse the `http` package to execute GET, POST, PUT, or DELETE requests. Use when you need to fetch from or send data to a REST API.37.9Kskills.sh installs
5twostraws avatarswiftui-protwostraws/swiftui-agent-skillComprehensively reviews SwiftUI code for best practices on modern APIs, maintainability, and performance. Use when reading, writing, or reviewing SwiftUI projec37.5Kskills.sh installs
6firebase avatarfirebase-firestore-standardfirebase/agent-skillsComprehensive guide for Firestore Standard Edition, including provisioning, security rules, and SDK usage. Use this skill when the user needs help setting up Fi37Kskills.sh installs