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

FilePurpose
main.dartEntry point only
app.dartMaterialApp or CupertinoApp, theme, top-level providers if any
routing.dartNamed routes or go_router setup when needed
*_view.dartWidget composition and simple layout branching
*_view_model.dartUI state, commands, orchestration
*_repository.dartData 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.