This is a simple Flutter sample app that demonstrates the principles of Clean Architecture, as introduced by Uncle Bob (Robert C. Martin), and uses different state management approaches (Provider and Riverpod) for reactive programming. The app fetches the user's IP address from the network and displays it in the center of the screen. It also includes a retry mechanism in case of network errors.
- Fetches the user's IP address from the network.
- Handles network errors and provides a retry option.
- Demonstrates Clean Architecture principles.
- Incorporates the implementation of different state managements (Provider, Riverpod).
- Implement IP address caching system
- Add multi-theme capability and dark mode
This project follows the Clean Architecture pattern, which separates the application into different layers:
- Presentation: Contains the UI components and handles user interactions. Uses the Provider and Riverpod package for state management.
- Domain: Contains interfaces of repositories, use cases, and entities.
- Data: Manages data sources (e.g., network, database), implements repositories, and contains models. Uses Dio for network management.
- Provider: State management library.
- Riverpod: State management library.
- Dio: HTTP client for making network requests.
- GetIt: Dependency injection package.
- Dartz: Functional programming in Dart.
- Mockito: Mocking library for testing (used for mocking test dependencies).
- build_runner: Dev dependency for code generation (used for code generation).
Before you begin, ensure you have Flutter installed on your local machine. For more information on Flutter installation, visit Flutter's official website.
Clone the repository to your local machine:
git clone https://github.com/m-r-davari/flutter_clean_architecture_sample.git