core/router/ — Navigation

Community

Auth-aware GoRouter navigation and guards

AuthorVantoan252003
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides a consistent, testable, and auth-aware navigation architecture for Flutter apps using GoRouter so that route transitions, redirects, and deep links behave predictably across the application.

Core Features & Use Cases

  • Centralized Router: Creates a singleton AppRouter with a full route tree and a single place to manage initialLocation, routes, shell routes, and nested navigation.
  • Auth-aware Redirects & Guards: Implements redirect logic tied to an AuthBloc and persistent onboarding state to automatically route unauthenticated users to login or onboarding flows.
  • Custom Transitions & Deep Links: Defines reusable custom page transitions and requires registration of a URI scheme for deep links, with a pattern for passing complex objects via typed extras.
  • Use Case: In a ride-hailing and food delivery client, ensure the splash, onboarding, auth, and main tabbed flows are correctly gated by authentication state and that order tracking pages receive typed IDs from deep links.

Quick Start

Create the AppRouter singleton using GoRouter with GoRouterRefreshStream(authBloc.stream), implement RouteGuards.redirectLogic reading AuthBloc and onboarding flag, and use typed state.extra for complex arguments.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: core/router/ — Navigation
Download link: https://github.com/Vantoan252003/Mozi/archive/main.zip#core-router-navigation

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.