🏠 Home

GoRouter Modular

GoRouter Modular Banner

Modular architecture for Flutter apps 🧩

Build scalable apps with clean modules and powerful routing.

Quick Start

flutter pub add go_router_modular
//== lib/main.dart ===================
 
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Modular.configure(
    appModule: AppModule(),
    initialRoute: '/',
  );
  runApp(AppWidget());
}
 
//== lib/src/app_widget.dart ===================
 
class AppWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ModularApp.router(
      title: 'My App',
    );
  }
}
 
//== lib/src/app_module.dart ===================
 
class AppModule extends Module {
  @override
  List<ModularRoute> get routes => [
    ModuleRoute('/', module: HomeModule()),
  ];
}
 
//== lib/src/modules/home/home_module.dart ===================
 
class HomeModule extends Module {
  @override
  FutureBinds (Injector i) { // Optional
    i.addSingleton<HomeController>((i) => HomeController());
  }
 
  @override
  List<ModularRoute> get routes => [
    ChildRoute('/', child: (context, state) => HomePage()),
  ];
}

What You Get

  • 🧩 Modules - Independent app pieces
  • 💉 Dependency Injection - Built-in DI
  • 🛣️ Smart Routing - Enhanced navigation
  • Page Transitions - Beautiful animations

Learn More