# Getting Started

Build your first modular Flutter app in 3 steps.

## 1. Install

```bash
flutter pub add go_router_modular
```


## 2. Setup App

```dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Modular.configure(
    appModule: AppModule(),
    initialRoute: '/',
    debugLogDiagnostics: true,
    debugLogDiagnosticsGoRouter: true,
    debugLogEventBus: true,
  );
  runApp(AppWidget());
}

class AppWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ModularApp.router(
      title: 'My App',
    );
  }
}

class AppModule extends Module {
  @override
  List<ModularRoute> get routes => [
    ModuleRoute('/', module: HomeModule()),
  ];
}

class HomeModule extends Module {

  @override
  FutureBinds (Injector i) { // Opitional
    i.addSingleton<HomeController>((i)=> HomeController());
  }

  @override
  List<ModularRoute> get routes => [
    ChildRoute('/', child: (context, state) => HomePage()),
  ];
}
```

That's it! Your modular app is ready.


## Next Steps

- [Routes & Modules](/routes/routes-system) - Learn routing
- [Dependency Injection](/dependency-injection) - Master DI
- [Page Transitions](/routes/transitions) - Add animations