A simple flutter app based on Reso Coder's tutorial but implemented using feature-driven architecture.
- Flutter bloc To implement the BLoC (Business Logic Component) design pattern.
- Freezed Code generation for data classes
- Get it Service location used as dependency injection
- Dartz
Functional Programming
Either<Left,Right>
- Auto Route Navigation package that uses code generation to simplify route setup
- Dio Http client for dart. Supports interceptors and global configurations
- Shared Preferences Persistent storage for simple data
- Flutter and Dart And obviously flutter and dart 😅
The data layer is the outermost layer of the application and is responsible for communicating with the server-side or a local database and data management logic. It also contains repository implementations.
Describes the process of acquiring and updating the data. Consist of remote and local Data Sources. Remote Data Source will perform HTTP requests on the API. At the same time, local Data sources will cache or persist data.
An entity will depend on the data acquired from the different data sources. Serialization of JSON structure into Dart maps Entity objects to Models and vice-versa.
The bridge between the Data layer and the Domain layer. Actual implementations of the repositories in the Domain layer. Repositories are responsible for coordinating data from the different Data Sources.
The domain layer is responsible for all the business logic. It is written purely in Dart without flutter elements because the domain should only be concerned with the business logic of the application, not with the implementation details.
Describes the logic processing required for the application. Communicates directly with the repositories.
Abstract classes that define the expected functionality of outer layers.
Business objects of the application. An entity will not depend on the data acquired from the server side.
The presentation layer is the most framework-dependent layer. It is responsible for all the UI and handling the events in the UI. It does not contain any business logic.
Widgets notify the events and listen to the states emitted from the Bloc.
Receive the events from the views and interact with use cases accordingly. Emit the state according to the data received from the use cases. Bloc does not know about the view at all. It communicates in the form of states and events only.
git clone https://github.com/Uuttssaavv/flutter_clean_arch
cd flutter_clean_arch
flutter pub get
flutter pub run build_runner build
flutter drive \ --driver=test_driver/integration_test.dart \ --target=integration_test/app_test.dart
flutter run
or simply press F5 key
if you are using VSCode
Do visit my portfolio site or connect with me on linkedin