Mobile — Flutter

Architecture & Project Structure

Separation that scales: four layers, each one only talking to the layer directly below it, and a project structure that keeps every feature’s data/domain/presentation code in one place.

Architecture

Separation that scales

Presentation → Domain → Data → Infrastructure. Each layer only talks to the one directly below it.

LayerContains
PresentationUI · Controllers
DomainEntities · Contracts
DataRepositories · Sources
InfrastructureREST · Firebase · Drift

The business logic layer (Domain) doesn't depend on any tool. It never talks to Drift, Dio, or Firestore directly — only the Data layer does that. This means you can test your business rules without needing a real database or an internet connection.

Project Structure

Predictable project organization

project structure

# Flutter Clean Architecture

lib/
├── core/
│   ├── network/
│   ├── database/
│   ├── sync/
│   └── ...
│
├── features/
│   └── sample_counter/
│       ├── data/
│       ├── domain/
│       └── presentation/
│
└── main.dart

docs/
├── ai_workflow.md
├── architecture.md
├── screen_flow.md
├── local_storage.md
├── design_systems/
│   └── tokens/
│       ├── colors.css
│       ├── spacing.css
│       └── typography.css
└── features/
    ├── index.md
    └── 00-sample-feature.md

.claude/
├── commands/
└── skills/

CLAUDE.md

The android/, ios/, and .metadata folders aren't included. This template only ships the lib/ and test/ folders — run flutter create . yourself to generate the rest (see Getting Started).