fbpx

Clean Architecture – Scalable Flutter application

Intro

This architecture has a layered structure and allows for clear separation of logic from the UI. It is based on the principles of SOLID and KISS, making it easy to use and maintain. It uses core packages such as linter, code formatting & automatization, network, BLoC, localization, dependency injection and Either. The structure of the architecture is represented with the diagram below.

The architecture described below is highly scalable and allows us to quickly implement new features.

Layers

Application separated into 4 layers.

Presentation

Layer “Presentation” interacts with layer “Business Logic” by triggering events and responding to state changes.

Business Logic

The “Business Logic” layer interacts with the “Domain” layer using methods to receive/send data.

Domain

The “Domain” layer interacts with the “Data” layer using methods that depend on the specific data source (for example, for API using requests/responses). Handling of all errors related to getting/parsing data is performed in this layer.

Data

The main advantages of this architecture are

  • clear separation of logic from the UI;
  • catching and logging all possible errors;
  • displaying localized and understandable error messages to users;
  • dependency injection;
  • lightweight blocs;
  • easy implementation of different themes;
  • ease of support and expansion;
  • strict adherence to the principles of SOLID and KISS;
  • simplicity.

Core Packages

Tell us your idea and we will find
a way to implement it