A complete guide to a scalable app in Flutter — Part 1 — Architecture: a domain-driven clean architecture.
Greetings everyone! It’s been a while since I’ve written, but I’m thrilled to be back and to share what I’ve learned and accomplished. Throughout the years, I’ve worked on several mobile-first apps that required high-quality, scalable code. Now, I want to pass on my knowledge and experiences to you and get your feedback in return.
In this series of articles, I’ll provide a full course on building a scalable app with a clean architecture that’s easily maintainable, allowing us to create a template ready to be used for new projects. The core of clean architecture is decoupling the scope of each layer and component, and our goal is to build an architecture that adheres to the following principles:
- Domain-driven architecture, with the domain layer as the middle layer that describes our models, the use cases, and the possible failures we need to handle.
- Separation of concerns between the data layer and the UI layer, with no dependencies between them.
- Adherence to the Single Responsibility Principle (SRP).
- Test coverage of 100%.
By the end of this course, you’ll have a fully functional app that adheres to these principles and serves as a starting point for any future app development. I’m thrilled to share my knowledge with you as well as learn from you. If you have any questions or feedback, please don’t hesitate to reach out to me.
The architecture infographic
Here is an infographic to showcase how this will be implemented in our course. We will detail the role of each layer and component below in this article.
Before starting, here are the links to the different articles that are part of this guide:
- Part 1 — Architecture: A model-driven clean architecture based on the MVVM pattern.
- Part 2 — Data layer
- Part 3—UI layer with the MVVM pattern (powered by Provider) .
- Part 4 — UI layer with complex Navigation and responsive layout (powered by Provider, go_router and…