Agent skill

flutter-navigation

Comprehensive guide for Flutter navigation and routing including Navigator API, go_router, deep linking, passing/returning data, and web-specific navigation. Use when implementing screen transitions, configuring routing systems, setting up deep links, handling browser history, or managing navigation state in Flutter applications.

Stars 89
Forks 13

Install this agent skill to your Project

npx add-skill https://github.com/MADTeacher/mad-agents-skills/tree/main/flutter-navigation

Metadata

Additional technical details for this skill

author
Stanislav [MADTeacher] Chernyshev
version
1.0

SKILL.md

Flutter Navigation

Overview

Implement navigation and routing in Flutter applications across mobile and web platforms. Choose the right navigation approach, configure deep linking, manage data flow between screens, and handle browser history integration.

Choosing an Approach

Use Navigator API (Imperative) When:

  • Simple apps without deep linking requirements
  • Single-screen to multi-screen transitions
  • Basic navigation stacks
  • Quick prototyping

Example: assets/navigator_basic.dart

Use go_router (Declarative) When:

  • Apps requiring deep linking (iOS, Android, Web)
  • Web applications with browser history support
  • Complex navigation patterns with multiple Navigator widgets
  • URL-based navigation needed
  • Production applications with scalable architecture

Example: assets/go_router_basic.dart

Avoid Named Routes

Flutter team does NOT recommend named routes. They have limitations:

  • Cannot customize deep link behavior
  • No browser forward button support
  • Always pushes new routes regardless of current state

Common Tasks

Pass Data Between Screens

With Navigator:

dart
Navigator.push(
  context,
  MaterialPageRoute(builder: (context) => DetailScreen(item: myItem)),
);

With go_router:

dart
context.push('/details?id=123');
// Extract: final id = state.uri.queryParameters['id'];

Example: assets/passing_data.dart

Return Data From Screens

dart
final result = await Navigator.push(
  context,
  MaterialPageRoute<String>(builder: (context) => SelectionScreen()),
);
if (!context.mounted) return;

Example: assets/returning_data.dart

Configure Deep Linking

Android: Configure AndroidManifest.xml intent filters iOS: Configure Info.plist for Universal Links Web: Automatic with go_router, choose URL strategy

For detailed setup: references/deep-linking.md

Web URL Strategy

Hash (default): example.com/#/path - no server config needed Path: example.com/path - cleaner URLs, requires server config

For server setup: references/web-navigation.md

Navigation Methods

go_router Navigation

  • context.go('/path') - replace current route
  • context.push('/path') - add to stack
  • context.pop() - go back

Navigator Navigation

  • Navigator.push() - add route to stack
  • Navigator.pop() - remove route from stack

Advanced Topics

Route Guards: Implement authentication redirects Nested Routes: Create shell routes with shared UI Error Handling: Handle 404 and navigation errors Multiple Navigators: Manage independent navigation stacks

For advanced patterns: references/go_router-guide.md

Decision Guide

Use navigation-patterns.md for:

  • Complete comparison of navigation approaches
  • Deep linking behavior by platform
  • Web-specific considerations
  • Common patterns and anti-patterns

Expand your agent's capabilities with these related and highly-rated skills.

MADTeacher/mad-agents-skills

flutter-animations

Comprehensive guide for implementing animations in Flutter. Use when adding motion and visual effects to Flutter apps: implicit animations (AnimatedContainer, AnimatedOpacity, TweenAnimationBuilder), explicit animations (AnimationController, Tween, AnimatedWidget/AnimatedBuilder), hero animations (shared element transitions), staggered animations (sequential/overlapping), and physics-based animations. Includes workflow for choosing the right animation type, implementation patterns, and best practices for performance and user experience.

89 13
Explore
MADTeacher/mad-agents-skills

flutter-duit-bdui

Integrate Duit framework into Flutter applications including setup, driver configuration, HTTP/WebSocket transports, custom widgets, and themes. Use when integrating backend-driven UI, configuring Duit, or adding Duit to Flutter applications.

89 13
Explore
MADTeacher/mad-agents-skills

flutter-drift

Complete guide for using drift database library in Flutter applications. Use when building Flutter apps that need local SQLite database storage with type-safe queries, reactive streams, migrations, and efficient CRUD operations. Includes setup with drift_flutter package, StreamBuilder integration, Provider/Riverpod patterns, and Flutter-specific database management for mobile, web, and desktop platforms.

89 13
Explore
MADTeacher/mad-agents-skills

agents-md-generator

Create or update minimal AGENTS.md files in the repository root and nested module directories using progressive disclosure. Works across heterogeneous projects without assuming any fixed agent folder structure.

89 13
Explore
MADTeacher/mad-agents-skills

flutter-architecture

Comprehensive guide for architecting Flutter applications following MVVM pattern and best practices with feature-first project organization. Use when working with Flutter projects to structure code properly, implement clean architecture layers (UI, Data, Domain), apply recommended design patterns, and organize projects using feature-first approach for scalable, maintainable apps.

89 13
Explore
MADTeacher/mad-agents-skills

flutter-testing

Comprehensive Flutter testing guidance covering unit tests, widget tests, and integration tests. Use when working with Flutter applications to write unit tests for functions/methods/classes, create widget tests to verify UI components, develop integration tests for end-to-end testing, mock dependencies and plugin interactions, debug common testing errors, test Flutter plugins with native code, and run tests in different build modes (debug, profile, release)

89 13
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results