Starter Shape
Use this shape for a real small app. It keeps the first version understandable without trapping you in one giant main.dart.
lib/
main.dart
app.dart
routing.dart
features/
notes/
notes_view.dart
notes_view_model.dart
notes_repository.dart
note.dart
services/
local_store.dart
test/
features/
notes/
notes_view_model_test.dart
notes_view_test.dart
integration_test/
app_smoke_test.dart
android/
ios/
web/
What Each File Is For
| File | Purpose |
|---|---|
main.dart | Entry point only |
app.dart | MaterialApp or CupertinoApp, theme, top-level providers if any |
routing.dart | Named routes or go_router setup when needed |
*_view.dart | Widget composition and simple layout branching |
*_view_model.dart | UI state, commands, orchestration |
*_repository.dart | Data source abstraction and local/network/plugin access coordination |
services/ | Storage, network, platform APIs, files, plugins |
What To Exclude From V1
- Separate packages for every layer.
- Generated dependency injection.
- A domain layer with pass-through use cases.
- A state-management package before state crosses feature boundaries.
- Flavors, CI release lanes, and store automation before the first manual release is understood.
Tip: Add complexity only when a test, feature, or platform target needs it.