Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Project structure · Mobile

Flutter project structure

Opens with credits

For anyone building one Dart app for Android, iOS and the web. The tree starts from what flutter create gives you and grows into a feature-first lib/ folder, where each feature keeps its own data, domain and presentation code, then adds tests at every level, flavors, release signing, crash reporting and, for large teams, a melos workspace of local packages.

Curated by Tauseef FayyazIntermediate224 files and foldersFlutter 3.47, Dart 3.13, flutter_riverpod 3.4Checked October 2026
Explore the filesPick any file to see what it is, why it exists and when you add it.

How it grows

Each stage opens the explorer there

  1. 1Day 1What the scaffold and your first hour give you48 files and folders
  2. 2GrowingWhat a real app with features and tests adds+95 files and folders
  3. ProductionWhat running it for real users adds+47 files and foldersOpens with credits
  4. ExpertWhat a team needs to keep it healthy for years+34 files and foldersOpens with credits

How it is organised

  • Group lib/ by feature, not by file type: everything about orders lives in lib/features/orders/, so a change touches one folder and a feature can be deleted cleanly.
  • Inside a feature, keep three layers: data (talks to the API or local storage), domain (plain Dart models and rules), presentation (screens, widgets and their controllers). Widgets never call HTTP directly.
  • The official Flutter architecture guide puts UI by feature and data by type (lib/ui, lib/data). Both work. Feature-first is shown here because it is what most teams and packages document, and it scales better once you have ten or more screens.
  • Pick one state management approach and use it everywhere. This tree uses Riverpod (providers you can override in tests, no BuildContext needed). Bloc is the other common choice: more ceremony, very explicit events and states, popular in larger teams. Both are fine; mixing them is not.
  • Shared code goes in lib/core/ only when two or more features use it, and core never imports features. In a large codebase those rules become packages in a melos workspace, where the compiler enforces them.
  • Test in layers: many unit tests for rules and repositories, widget tests for every screen state, goldens for key widgets, and a few integration tests for the journeys that make money.
  • Anything compiled into the app (dart-define values, assets, Firebase ids) can be extracted from it. Real secrets stay on your server; tokens go to secure storage; obfuscation only slows attackers down.
  • Only generate the platforms you ship: every extra platform folder is code you have to keep building and upgrading.

At the top of the project

Open one in the explorer for the full story

Learn more on Sefism

Roadmaps, cheat sheets and projects that go with Flutter.

See 8 more
Checked against 18 official sources, October 2026. If something has changed, the docs win.Show sources

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com