flutter create gives you a skeleton, not an architecture. The first decision that outlives every other one is how you organize your folders. There are two common answers.
Layer-first: group by technical role
lib/ models/ user.dart order.dart views/ login_page.dart orders_page.dart controllers/ auth_controller.dart orders_controller.dart
Enter fullscreen mode
Exit fullscreen mode
Everything of one kind lives together. It feels tidy with five screens.
Feature-first: group by what the app does
lib/ features/ authentication/ data/ state/ ui/ user_profile/ data/ state/ ui/ orders/ data/ state/ ui/ shared/
Enter fullscreen mode
Exit fullscreen mode
Each folder under features/ holds the UI, state and repository for one feature.
Why feature-first scales better
For large production apps, organizing by feature scales better than organizing by technical function. Three reasons from the source article:
It isolates domain logic.…