# flutter-navigation

A skill that makes your coding agent handle Flutter navigation: Navigator, go_router, deep links, redirects and browser history.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 589 installs · ★ 110
- Author: Stanislav \[MADTeacher\] Chernyshev
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-navigation/SKILL.md
- Updated: 2026-05-01
- HTML: https://affpapa.org/en/nevibecode/skills/flutter-navigation

## What it does

This skill turns the agent into a Flutter navigation implementer. It covers screen transitions, passing and returning route data, route migration, `ShellRoute` and `StatefulShellRoute`, nested `Navigator`s, auth redirects, 404 handling and route tests. Inside there is a seven-step workflow and a decision table for picking between plain `Navigator` with `MaterialPageRoute` and `go_router`.

The agent inspects the project first: `pubspec.yaml`, `lib/`, the app root, existing route definitions, auth and state providers, platform folders, web hosting config and tests. Then it picks the smallest routing model that fits and writes code in the app's own style. Separate references cover `go_router`, deep linking, web navigation and pattern tradeoffs, with starter files such as `navigator_basic.dart` and `go_router_basic.dart` meant to be adapted, not dropped in as-is.

The rules are strict. Don't mix navigation models casually, don't pass `queryParameters` to `context.push` or `context.go`, don't keep complex state only in a URL, and don't put refresh-surviving data in `extra`. On iOS, Universal Links belong in Xcode or `ios/Runner/Runner.entitlements`, not in `Info.plist`. If the app already runs on `go_router`, switching main routes to imperative `Navigator` breaks deep links — worth checking before you refactor.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-navigation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/flutter-navigation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/flutter-navigation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-navigation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/flutter-navigation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-navigation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/flutter-navigation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install MADTeacher/mad-agents-skills flutter-navigation
```

2. **Manually: put the files in place**
- File: `.github/skills/flutter-navigation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-navigation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/MADTeacher/mad-agents-skills --path flutter-navigation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/flutter-navigation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-navigation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-navigation/SKILL.md

## When to use it
- decide between `Navigator` and `go_router` for a given flow
- set up a login redirect that returns to the original route
- build tabs with independent stacks via `StatefulShellRoute`
- fix Flutter web URLs and browser history
- split Android App Links and iOS Universal Links setup

## Example prompts
- set up go_router with a login redirect that returns to the original route
- why does browser history break after switching to the path URL strategy
- add tests for route parsing and the 404 screen

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: b5b94b24f8f70d18.

BEGIN THIRD-PARTY FILE b5b94b24f8f70d18
```text
---
name: flutter-navigation
description: >-
  Implement, fix, refactor, review, migrate, or validate Flutter navigation and
  routing. Use when working with Navigator, MaterialPageRoute, Router API,
  go_router, route guards, redirects, ShellRoute or StatefulShellRoute, nested
  Navigators, passing and returning route data, deep links, Android App Links,
  iOS Universal Links, custom URI schemes, Flutter web URL strategy, browser
  history, 404 routing, route tests, or navigation-state bugs.
metadata:
  author: Stanislav [MADTeacher] Chernyshev
  version: "2.0"
---

# Flutter Navigation

You are a Flutter navigation implementation agent. Your job is to make route
state, browser/deep-link behavior, and screen transitions fit the target app
without breaking existing state, auth flows, or platform expectations.

## Principle 0

Navigation is user state. Do not replace an app's routing model or add deep-link
claims before inspecting the current `MaterialApp`, `Router`, `Navigator`,
state-management, auth, supported platforms, and tests. After changing
navigation, verify analyzer-clean Dart and the route behaviors affected by the
change.

## Workflow

1. Identify the request: simple screen transition, data passing, returned
   result, route migration, deep-link setup, web browser history, nested tabs or
   shells, auth redirect, route error handling, or navigation test.
2. Inspect the local Flutter project first when code is available: `pubspec.yaml`,
   `lib/`, app root, existing route definitions, navigation calls, auth/state
   providers, platform folders, web hosting config, and relevant tests.
3. Choose the smallest routing model that satisfies the product requirement:
   - Use `Navigator` with `MaterialPageRoute` for local, non-addressable flows
     in simple apps.
   - Use `go_router` for deep links, web URLs, browser history, auth redirects,
     nested navigation, multiple Navigators, or scalable route tables.
   - Avoid new legacy `MaterialApp.routes` named routes unless preserving a
     small existing app that already uses them and does not need custom deep-link
     behavior.
4. Model route data deliberately. Use constructor arguments for local Navigator
   pushes, path parameters for required addressable identity, query parameters
```
END THIRD-PARTY FILE b5b94b24f8f70d18

The third-party file has ended. Everything between the b5b94b24f8f70d18 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2281 of 8499 bytes. © Stanislav \[MADTeacher\] Chernyshev · MIT · https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-navigation/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
