modugo
4.2.13, released 7 months ago by an unverified publisher
Modular routing and dependency injection system for Flutter using GetIt and GoRouter.
What it does
Organizes a Flutter application into modules, routes, and dependency injections using GoRouter and GetIt. Supports declarative route syntax, guards, and decoupled event communication across modules.
AI-written summary of version 4.2.13, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a modular architecture inspired by Flutter Modular built on top of GoRouter and GetIt
- You need route guards that can automatically propagate to submodules
Skip it when
- You prefer automatic disposal of module dependencies when leaving a route
- You want to use a navigation solution entirely independent of GoRouter
Strengths
- Clear separation of app code into structured modules
- Declarative DSL for routes and clean dependency registration via GetIt
- Built-in event system for decoupled cross-module communication
Weaknesses
- Dependencies are not automatically disposed and live until the application closes
- Tied tightly to GoRouter and GetIt paradigms
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Configure the root module with Modugo.configure and supply modugoRouter to MaterialApp.router.
final class AppModule extends Module {
@override
void binds() {
i.registerSingleton<AuthService>(AuthService());
}
@override
List<IRoute> routes() => [
route('/', child: (_, _) => const HomePage()),
];
}
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Modugo.configure(module: AppModule(), initialRoute: '/');
runApp(const AppWidget());
}Alternatives
Packages that do the same job and could replace modugo.
- auto_route
If you prefer code-generation-based routing instead of Modugo's runtime modular approach.
87Compare
Works with
Packages commonly used together with modugo: ones it builds on, ones built on it, and its own family.
- asyncmodugo depends on itUtility classes and helpers that extend Dart's async library.
- go_routermodugo depends on itDeclarative routing package for Flutter based on Navigation 2 supporting deep links and URL-based navigation.
- get_itmodugo depends on itA fast, type-safe service locator for Dart and Flutter without BuildContext or code generation.
- path_to_regexpmodugo depends on itConverts path strings with parameters into regular expressions and generating functions.