In this article I will share a brief overview of how I implement Clean Architecture in my Flutter application.
Sample of flutter using Clean Architecture and MVVM.
We’ll create a functional reactive ViewModel using Darts Stream API.
Before we look at any code, we should get a basic understanding of MVVM (Model-View-ViewModel).
There are 3 main modules to help separate the code. They are Data, Domain, and Application.
Data contains Local Storage, APIs, Data objects (Request/Response object, DB objects), and the repository implementation.
Domain contains UseCases, Domain Objects/Models (Pojos/Kotlin Data Classes), and Repository Interfaces
Application contains UI, View Objects, Android components, etc. Can be split into separate modules itself if needed. For example, we could have a module called Device handling things like camera, location, etc.