Modular architecture, dependency injection & route management on top of GoRouter.
GoRouter Modular brings a modular architecture on top of GoRouter, with per-module dependency injection and automatic dispose. Split a large app into independent, lazy-loaded feature modules — perfect for micro frontends and scalable, team-friendly codebases. 🚀
💡 Inspired by flutter_modular by Flutterando — we're grateful for their contribution to the Flutter ecosystem.
✨ Features
🧩 Modular Architecture
Independent, reusable feature modules
💉 Dependency Injection
Built-in DI with automatic dispose
🛣️ GoRouter Integration
Type-safe, declarative navigation
🎭 Event System
Decoupled, event-driven communication between modules
🚀 Lazy Loading
Modules load on demand with efficient memory management
context.goNamed('profile'); // replace the stack
context.pushNamed('home'); // push on topfinal controller = Modular.get<HomeController>(); // resolve a dependency
🤖 Agent Skill
This repo ships an Agent Skill that teaches AI coding agents (Claude Code, Cursor, Codex, OpenCode, and others) the recommended conventions for this package — per-feature route files, named-only navigation, typed binds via the .. cascade, synchronous modules, and kDebugMode-gated logs. The agent then applies them automatically when you scaffold routes, modules, or navigation.
Install it into your project with one command (via the skills CLI):
The CLI detects your installed agents and drops the skill into the right place (e.g. .claude/skills/). Add -g to install it globally for every project.
Optional — events add-on
If your app uses the event system (EventModule, ModularEvent, ModularEventMixin) for decoupled cross-module communication, install the separate events skill too: