Clean architecture revolves around converting the existing architecture into loosely coupled layers.
This saves time and is future-proof. Although not easy to explain, any architecture can be called a clean architecture if it decouples the layers. Some of the examples may include:
One more thing to remember is the dependency rule. It is related to the information isolation, meaning every inside layer must not know anything about the outside rule, as illustrated in the image below:
Note: The inside layers do not depend on the outside layers, but the reverse is true.
Note: There are other rules too, but the dependency rule must always apply to have a clean architecture.
For Flutter, these layers are usually divided into four categories:
The project hierarchy may look like the code below:
domain/user/manager/app/widgets/pages/data/readme/repository/device/utils/repository/
Note: This hierarchy may vary from project to project but should essentially consist of such layers.
The layers for Flask are usually divided into the following layers:
app/app.py/request/response/config/requirements/readme/core/repository/usecase/extension/plugins/infra/cache/network/main/test/
Free Resources