This is a Flutter project boilerplate that adheres to the principles of Clean Architecture. It is designed to help you jumpstart your Flutter projects by providing a structured and organized project setup. This boilerplate utilizes the BLoC state management pattern, GetIt for dependency injection, and Freezed for code generation.
The project follows a well-defined directory structure to keep your code organized and maintainable. Here's an overview of the key directories:
-
Src: The main source code directory.
-
Common: Contains common files such as API endpoints, constants, exceptions, colors, screen sizes, and enums.
-
Data: Responsible for data handling.
-
Datasource: Data sources, such as API clients or databases.
-
Model: Data models that represent your application's data.
-
Repository: Data repositories, which abstract the data source.
-
-
Domain: Contains the core business logic.
-
Entity: Business entities or domain models.
-
Repository: Interfaces that define how data is accessed in the domain layer.
-
Usecase: Use cases that represent the application's business operations.
-
-
Presentation: Handles the user interface and interaction.
-
Bloc: BLoC classes responsible for managing the state of your application.
-
Cubit: Cubit classes for more lightweight state management.
-
Page: Flutter pages/screens.
-
Widget: Reusable UI components.
-
-
Utilities: Helper classes and utilities for the application.
-
-
Injection.dart: Dependency injection setup using GetIt.
-
Main.dart: The entry point of the Flutter application.
-
Clone this repository to your local machine:
git clone https://github.com/risfat/flutter-bloc-clean-architecture-boilerplate
-
Navigate to the project directory:
cd flutter-bloc-clean-architecture-boilerplate
-
Install dependencies using Flutter's package manager:
flutter pub get
You can now start building your application using this clean architecture boilerplate.
- Structured and organized project setup.
- Clean Architecture pattern.
- BLoC state management.
- GetIt for dependency injection.
- Freezed for code generation.
Feel free to contribute to this project by submitting issues or pull requests. If you have any suggestions or improvements, we welcome your contributions.
Happy coding! 🚀