Comprehensive guide for architecting Flutter applications following MVVM pattern and best practices with feature-first project organization. Use when working with Flutter projects to structure code properly, implement clean architecture layers (UI, Data, Domain), apply recommended design patterns, and organize projects using feature-first approach for scalable, maintainable apps.
Provides architectural guidance and best practices for building scalable Flutter applications using MVVM pattern, layered architecture, and recommended design patterns from the Flutter team.
Choose the right project organization based on your app's complexity and team size.
Organize code by business features:
lib/
├── features/
│ ├── auth/
│ │ ├── data/
│ │ ├── domain/
│ │ └── presentation/
│ ├── todos/
│ │ ├── data/
│ │ ├── domain/
│ │ └── presentation/
│ └── settings/
│ ├── data/
│ ├── domain/
│ └── presentation/
├── shared/
│ ├── core/
│ ├── data/
│ └── ui/
└── main.dart
When to use:
Benefits:
See Feature-First Guide for complete implementation details.
Organize code by architectural layers:
lib/
├── data/
│ ├── repositories/
│ ├── services/
│ └── models/
├── domain/
│ ├── use-cases/
│ └── entities/
├── presentation/
│ ├── views/
│ └── viewmodels/
└── shared/
When to use:
Benefits:
Start with these core concepts:
For detailed concepts, see Concepts.
Flutter apps should be structured in layers:
See Layers Guide for detailed layer responsibilities and interactions.
Common patterns for robust Flutter apps:
See Design Patterns for implementation details.
Use this skill when: