r/FlutterDev • • 4d ago

Discussion Flutter Project Structure

Is this a good starting structure for a Flutter project? Is it simple, well-organized, and suitable for future growth and expansion?

lib/

├── main.dart

├── app.dart

├── core/

├── l10n/

└── features/

0 Upvotes

10 comments sorted by

1

u/raman4183 4d ago

Yes, that is pretty solid and basic. You should start with this.

Growth and Expansion will largely depend on how decoupled your modules are.

1

u/just_kinoosaki 4d ago

That's a clean starting point. The `features/` folder is going to do most of the heavy lifting as you scale, so how you split things up inside there matters way more than anything else at this stage. `core/` and `l10n/` are good calls though, keeps the boilerplate from strangling your app logic later.

1

u/J_Galang 4d ago

Depends on the scope of the app. Is a good start 🤘

1

u/Tiny-Manufacturer187 3d ago

I prefere screen oriented folder structure not feature oriented.

1

u/JohnnyJohngf 3d ago

What if the feature doesn’t have a screen?

1

u/Tiny-Manufacturer187 2d ago

Then go with rust or python, why are you using dart then?

1

u/Ashraf_Alrashidi 2d ago

Looks like a fine starting point. One thing I'd add: keep each feature's data, logic and UI together inside its own folder (for example features/prayer_times/ with data/, logic/ and ui/), and put only truly shared things (theme, routing, small utils) in core/. If two features start importing each other's internals, that's the sign to move the shared piece into core/ or merge them. For a small app you don't need full clean-architecture layers up front, you can add them later when a feature actually grows.

1

u/kuarasoft 2d ago

core/ next to features/ is a good split, and what decides whether it scales is which way the imports point: features should import from core, never from each other. Keep core small (theme, routing, the network client) and don't let a generic utils/ folder become the place everything ends up. Inside each feature, data/ and presentation/ is enough to start, and a domain/ layer can wait until there's real logic to put in it. When a second feature needs something from the first, that's the moment to move it into core or a shared folder. For a small app, that's plenty of structure.

1

u/AdhesivenessFew8441 1d ago

That is a good start, and feature-first is the right call. A few things that helped me when apps grew: inside each feature, split into data (API calls, models, repositories), logic (state, use cases) and presentation (screens, widgets), so a screen never talks to the API directly. Keep core small: theme, routing, constants, a shared HTTP client and error handling, not business logic, or it turns into a junk drawer. Pick one state management approach early (Riverpod or Bloc both scale well) and use it everywhere. Add a test folder that mirrors lib from day one, even with only a few tests. And do not over-engineer it before you have three or four real features: moving files later is easy, working inside an empty architecture is not.

1

u/solo_appdev_kr 1d ago

Yeah, feature folders are the right direction. What actually cost me the most as my app grew was state and storage logic leaking into widgets a little at a time, and pulling it back out later was way more work than keeping it out from the start. Since then I keep a small data layer inside each feature, and that alone has saved me from repeating it.