# flutterando/modular architecture

> Architecture diagram of the GitHub repository flutterando/modular, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flutterando/modular
- Repository: https://github.com/flutterando/modular

## Overview

Flutter Modular is a Flutter library for organizing applications by feature module, with routes and dependency injection declared together and state scoped to route lifecycles. The documented workflow is developers define modules and register dependencies/routes, bootstrap the root module, then navigate through nested or guarded routes while route-scoped state is created and disposed. The tree supports the implementation paths below, but no source excerpts were provided; relationships therefore cite only README-level documentation, and unsampled internals are not inferred.

Main entry points: [`lib/src/route/modular_route.dart`](https://github.com/flutterando/modular/blob/master/lib/src/route/modular_route.dart) (Route definitions), [`lib/src/module/module.dart`](https://github.com/flutterando/modular/blob/master/lib/src/module/module.dart) (Module declarations), [`lib/src/app/modular_app.dart`](https://github.com/flutterando/modular/blob/master/lib/src/app/modular_app.dart) (App bootstrap), [`lib/src/navigation/modular_router_config.dart`](https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_router_config.dart) (Router config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_composition["Module Composition"]
  node_module["Module declarations<br/>[module.dart]"]
  node_app["App bootstrap<br/>[modular_app.dart]"]
  node_api["Public API"]
end

subgraph group_routing["Navigation"]
  node_router_config["Router config"]
  node_route_parser["Route parser"]
  node_router_delegate["Router delegate"]
  node_navigation["Navigation actions"]
  node_resolver["Route resolver"]
  node_route["Route definitions<br/>[modular_route.dart]"]
  node_route_state["Route state<br/>[route_state.dart]"]
  node_outlet["Nested outlets<br/>[outlet.dart]"]
  node_transition["Route transitions<br/>[transition.dart]"]
end

subgraph group_state["Scoped State"]
  node_consumer["State consumer<br/>[consumer.dart]"]
  node_scoped["Scoped state<br/>[scoped.dart]"]
end

node_developer(("App developer"))
node_flutter_app(("Flutter application"))

node_developer -->|"declares modules"| node_module
node_developer -->|"bootstraps app"| node_app
node_module -->|"declares routes"| node_router_config
node_module -->|"registers dependencies"| node_module
node_app -->|"bootstraps runtime"| node_flutter_app
node_flutter_app -->|"navigates routes"| node_navigation
node_router_config -.->|"configures routing"| node_route_parser
node_route_parser -.->|"resolves locations"| node_router_delegate
node_router_delegate -.->|"dispatches routes"| node_resolver
node_resolver -.->|"matches routes"| node_route
node_route -.->|"provides route state"| node_route_state
node_route -->|"supports nesting"| node_outlet
node_route -->|"configures transitions"| node_transition
node_route_state -->|"scopes state"| node_scoped
node_scoped -.->|"supplies state"| node_consumer

click node_module "https://github.com/flutterando/modular/blob/master/lib/src/module/module.dart"
click node_app "https://github.com/flutterando/modular/blob/master/lib/src/app/modular_app.dart"
click node_api "https://github.com/flutterando/modular/blob/master/lib/flutter_modular.dart"
click node_router_config "https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_router_config.dart"
click node_route_parser "https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_route_information_parser.dart"
click node_router_delegate "https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_router_delegate.dart"
click node_navigation "https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_navigation.dart"
click node_resolver "https://github.com/flutterando/modular/blob/master/lib/src/navigation/route_resolver.dart"
click node_route "https://github.com/flutterando/modular/blob/master/lib/src/route/modular_route.dart"
click node_route_state "https://github.com/flutterando/modular/blob/master/lib/src/route/route_state.dart"
click node_outlet "https://github.com/flutterando/modular/blob/master/lib/src/navigation/outlet.dart"
click node_transition "https://github.com/flutterando/modular/blob/master/lib/src/navigation/transition.dart"
click node_consumer "https://github.com/flutterando/modular/blob/master/lib/src/state/consumer.dart"
click node_scoped "https://github.com/flutterando/modular/blob/master/lib/src/state/scoped.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_module,node_app,node_api toneBlue
class node_router_config,node_route_parser,node_router_delegate,node_navigation,node_resolver,node_route,node_route_state,node_outlet,node_transition toneAmber
class node_consumer,node_scoped toneMint
class node_developer,node_flutter_app toneIndigo
```

## Components

### Module Composition

- [Module declarations](https://github.com/flutterando/modular/blob/master/lib/src/module/module.dart): `lib/src/module/module.dart`
- [App bootstrap](https://github.com/flutterando/modular/blob/master/lib/src/app/modular_app.dart): `lib/src/app/modular_app.dart`
- [Public API](https://github.com/flutterando/modular/blob/master/lib/flutter_modular.dart): `lib/flutter_modular.dart`

### Navigation

- [Router config](https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_router_config.dart): `lib/src/navigation/modular_router_config.dart`
- [Route parser](https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_route_information_parser.dart): `lib/src/navigation/modular_route_information_parser.dart`
- [Router delegate](https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_router_delegate.dart): `lib/src/navigation/modular_router_delegate.dart`
- [Navigation actions](https://github.com/flutterando/modular/blob/master/lib/src/navigation/modular_navigation.dart): `lib/src/navigation/modular_navigation.dart`
- [Route resolver](https://github.com/flutterando/modular/blob/master/lib/src/navigation/route_resolver.dart): `lib/src/navigation/route_resolver.dart`
- [Route definitions](https://github.com/flutterando/modular/blob/master/lib/src/route/modular_route.dart): `lib/src/route/modular_route.dart`
- [Route state](https://github.com/flutterando/modular/blob/master/lib/src/route/route_state.dart): `lib/src/route/route_state.dart`
- [Nested outlets](https://github.com/flutterando/modular/blob/master/lib/src/navigation/outlet.dart): `lib/src/navigation/outlet.dart`
- [Route transitions](https://github.com/flutterando/modular/blob/master/lib/src/navigation/transition.dart): `lib/src/navigation/transition.dart`

### Scoped State

- [State consumer](https://github.com/flutterando/modular/blob/master/lib/src/state/consumer.dart): `lib/src/state/consumer.dart`
- [Scoped state](https://github.com/flutterando/modular/blob/master/lib/src/state/scoped.dart): `lib/src/state/scoped.dart`

### Other components

- **App developer**
- **Flutter application**

## Connections

- App developer → Module declarations: declares modules (evidence: `README.md`)
- App developer → App bootstrap: bootstraps app (evidence: `README.md`)
- Module declarations → Router config: declares routes (evidence: `README.md`)
- Module declarations → Module declarations: registers dependencies (evidence: `README.md`)
- App bootstrap → Flutter application: bootstraps runtime (evidence: `README.md`)
- Flutter application → Navigation actions: navigates routes (evidence: `README.md`)
- Router config → Route parser: configures routing
- Route parser → Router delegate: resolves locations
- Router delegate → Route resolver: dispatches routes
- Route resolver → Route definitions: matches routes
- Route definitions → Route state: provides route state
- Route definitions → Nested outlets: supports nesting (evidence: `README.md`)
- Route definitions → Route transitions: configures transitions (evidence: `README.md`)
- Route state → Scoped state: scopes state (evidence: `README.md`)
- Scoped state → State consumer: supplies state
