A Flutter application demonstrating clean architecture, SOLID principles, and best practices in mobile app development.
The User List App is a demonstration of how to build a scalable and maintainable Flutter application. It implements a simple user management system with features to view, add, and delete users while showcasing various software engineering principles and best practices.
The project follows Clean Architecture principles, divided into three main layers:
- Contains business logic and rules
- Defines entities and repository interfaces
- Houses use cases that encapsulate business operations
- Independent of any external frameworks
- Implements repository interfaces
- Handles data operations and transformations
- Manages local storage through data sources
- Implements caching mechanisms
- Contains UI components and controllers
- Manages state and user interactions
- Implements the user interface using Flutter widgets
- Each use case handles one specific operation (GetUsers, AddUser, DeleteUser)
- Repository implementation focuses solely on data operations
- Controllers are responsible only for UI state management
- Data sources handle only storage operations
- Repository interfaces allow new implementations without modifying existing code
- Use cases can be extended without changing existing ones
- Failure handling system is extensible with new failure types
- Repository implementations properly substitute their interfaces
- Models extend entities without breaking behavior
- All implementations can be substituted with their base types
- Repository interfaces are focused and minimal
- Use cases have specific interfaces for their needs
- Data source interfaces include only necessary methods
- High-level modules depend on abstractions
- Low-level modules implement abstractions
- Dependencies are injected through constructors
- Dependency injection container manages object creation
- Consistent use of Either type for error handling
- Well-defined failure types
- Descriptive error messages with context
- Proper error propagation through layers
- Comprehensive unit tests
- Mock objects for testing
- Test coverage monitoring
- Testable architecture design
- Feature-based folder structure
- Clear separation of concerns
- Consistent naming conventions
- Clean and maintainable code
- Centralized state management
- Predictable state updates
- Clear state transitions
- Efficient UI updates
- Proper dependency injection
- Clear dependency graph
- Manageable dependencies
- Easy dependency updates
lib/
├── core/
│ ├── base/
│ │ ├── base_state.dart
│ │ └── base_view_model.dart
│ ├── error/
│ │ └── failures.dart
│ ├── usecase/
│ │ └── usecase.dart
│ └── config/
│ └── environment.dart
├── features/
│ └── user_list/
│ ├── data/
│ │ ├── datasources/
│ │ ├── models/
│ │ └── repositories/
│ ├── domain/
│ │ ├── entities/
│ │ ├── repositories/
│ │ └── usecases/
│ └── presentation/
│ ├── controllers/
│ ├── pages/
│ └── state/
└── injection_container.dart
- Clone the repository
- Run
flutter pub get
to install dependencies - Run
flutter test
to execute tests - Run
flutter run
to start the application
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.