Keyboard Shortcuts

j / kScroll down / up
ggScroll to top
GScroll to bottom
/Open search
?Show this help
EscClose search / help
n / NNext / previous section
hGo to landing
dGo to docs
:Command mode — type section name

Press ? or Esc to close

Flutter Architecture Blueprint

A pragmatic
Flutter architecture.
Feature-first.

One way to build features. Predictable structure, zero ceremony.
Cubit by default. Store owns data. DI scoped to routes.

Read the docs  →

Philosophy

No over-engineering.
Only what matters for mobile.

Low cognitive load. Low effort to add new features. No abstractions you didn't ask for.

01

Feature-first

Organized by feature, not by type. Easy to find, delete, or reuse a feature without touching anything else.

02

Store = data truth

One place for all data logic: cache strategy, network calls, error handling. Nothing else touches the data.

03

Cubit = UI truth

Cubit by default. Bloc only when event transformations or traceability are needed. Not "better" — more structured.

04

Lazy DI per feature

Registered on route entry, destroyed on exit. Fast startup, low memory, zero cross-feature coupling.

05

Design tokens only

No hardcoded colors, sizes, or strings. context.colors.* is the only API into the theme system.

06

sqflite is opt-in

Don't add by default. Add per feature, only when offline support is a genuine requirement — not nice-to-have.

Data Flow

One direction.
No exceptions.

Every request follows the same path. No shortcuts, no UI that fetches data directly, no hidden side effects.

API / Cache / DB
data sources
Store
orchestration · errors · cache
Cubit / Bloc
ApiResponse state
UI
stateless · read-only

Tech Stack

Deliberate choices.
No unnecessary dependencies.

Every package earned its place. Nothing added speculatively.

LayerTechnology
FrameworkFlutter · Dart
State Mgmtflutter_bloc — Cubit (default) / Bloc (complex)
DIget_it — lazy singletons, feature-scoped
Routinggo_router with StatefulShellRoute
Networkdio with auth, logging, error interceptors
Local Storageshared_preferences · flutter_secure_storage · sqflite (opt-in)
FirebaseCore · Analytics · Crashlytics · Messaging · Remote Config
WebViewflutter_inappwebview with JS bridge
LocalizationCustom 3-source: file cache → remote → asset
sam's arch — A Pragmatic Flutter Architecture