AntonyChinVal / flutter-clean-architecture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CleanFlutter

A Flutter project with Clean Architecture. For the link of the project presentation, click here.

Introduction

It's a layered and domain-centric architecture.

With the following advantages:

  • Structuring
  • Decoupling
  • Testable
  • Independence

Dependency Rule

This rule says that source code dependencies can only point inwards.

Layers

Domain

The Domain layer defines the business logic of the application.

  • Core : The main classes that are used in the Domain layer.
  • Entities : Enterprise wide business rules.
  • UseCases : Application specific business rules.
  • Repositories : Abstract classes that define the expected functionality of outer layers.
cd clean_project/layers/domain

Data

The Data layer is responsible for data retrieval.

  • Repositories : Concrete classes that implement the repository from the domain layer.
  • ExternalData : Data source(Rest Api, Firebase , Device).
cd clean_project/layers/data

Presentation

The Presentation layer is the representation of the application.

  • Configuration : Initial settings of the Presentation layer (Navigation, Initialization).
  • Screens : Represents the user interface, events, and lifecycle.
cd clean_project/layers/presentation

or

cd clean_project/layers/getx_presentation

App

The App layer contains all the general app configurations(Platform(IOS,Android), Dependency Injection, Run App).

cd clean_project/lib

Installation

Install flutter to run the project.

Run the following commands

cd clean_project

flutter pub get

Run with Riverpod

flutter run

Run with GetX

WITH_GETX=true
flutter run

Libraries

References

Help

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

About


Languages

Language:Dart 37.6%Language:C++ 27.5%Language:CMake 23.3%Language:Ruby 3.4%Language:HTML 2.3%Language:Shell 2.0%Language:C 1.8%Language:Swift 1.7%Language:Kotlin 0.2%Language:Objective-C 0.0%