This repository contains the Products App, a clean architecture project built with Flutter. The app demonstrates a clean and maintainable code structure, focusing on modularity and scalability.
The project follows a well-defined folder structure to ensure code maintainability and clarity:
lib/
├── config/
│ ├── routes/
│ │ └── router.dart
│ ├── theme/
│ └── app_theme.dart
├── core/
│ ├── constants/
│ │ └── constants.dart
│ ├── resources/
│ │ └── data_state.dart
│ ├── usecase/
│ │ └── usecase.dart
│ ├── util/
│ ├── converter/
│ └── rating_converter.dart
├── features/
│ ├── products/
│ │ ├── data/
│ │ │ ├── model/
│ │ │ │ ├── products.dart
│ │ │ │ └── rating.dart
│ │ │ ├── repository/
│ │ │ │ └── products_repository_impl.dart
│ │ │ ├── sources/
│ │ │ ├── local/
│ │ │ │ ├── app_database.dart
│ │ │ │ ├── app_database.g.dart
│ │ │ │ └── dao/
│ │ │ │ └── products_dao.dart
│ │ │ ├── remote/
│ │ │ ├── products_api_service.dart
│ │ │ └── products_api_service.g.dart
│ │ ├── domain/
│ │ │ ├── entities/
│ │ │ │ └── products.dart
│ │ │ ├── repository/
│ │ │ │ └── products_repository.dart
│ │ │ ├── usecase/
│ │ │ ├── delete_product_use_case.dart
│ │ │ ├── get_products_use_case.dart
│ │ │ ├── get_saved_use_case.dart
│ │ │ └── save_product_use_case.dart
│ │ ├── presentation/
│ │ ├── bloc/
│ │ │ ├── products/
│ │ │ ├── local/
│ │ │ │ ├── local_products_bloc.dart
│ │ │ │ ├── local_products_event.dart
│ │ │ │ └── local_products_state.dart
│ │ │ ├── remote/
│ │ │ ├── remote_products_bloc.dart
│ │ │ ├── remote_products_event.dart
│ │ │ └── remote_products_state.dart
│ │ ├── pages/
│ │ │ ├── cart/
│ │ │ │ └── cart_product_screen.dart
│ │ │ ├── detail/
│ │ │ │ └── product_detail_screen.dart
│ │ │ ├── home/
│ │ │ └── products_screen.dart
│ │ ├── widgets/
│ │ ├── appbar_widget.dart
│ │ ├── cart_widget.dart
│ │ └── products_widget.dart
├── injection_container.dart
├── main.dart
This project leverages the following dependencies and tools:
- Flutter SDK
- cupertino_icons
^1.0.8
- flutter_bloc
^8.1.6
- equatable
^2.0.5
- get_it
^8.0.2
- intl
^0.20.0
- floor
^1.5.0
- flutter_hooks
^0.20.5
- cached_network_image
^3.2.0
- dio
^5.7.0
- go_router
^14.2.8
- ionicons
^0.2.2
- flutter_test
- flutter_lints
^4.0.0
- retrofit_generator
^9.1.5
- floor_generator
^1.5.0
- build_runner
^2.4.13
- Clean Architecture: Adopts a structured approach to separate concerns into layers.
- State Management: Utilizes
flutter_bloc
for efficient state management. - Data Persistence: Implements the
floor
library for local database management. - API Integration: Integrates RESTful APIs using
dio
andretrofit_generator
. - Routing: Efficient navigation using
go_router
. - Responsive UI: Modular widget system to ensure adaptability across devices.
-
Clone the repository:
git clone https://github.com/your-username/ProductsAppCleanArchitecture.git cd ProductsAppCleanArchitecture
-
Install dependencies:
flutter pub get
-
Run the app:
flutter run
Feel free to contribute, raise issues, or suggest improvements for this project! 🚀