A simple Todo app built with Flutter and GetX, demonstrating clean architecture and best practices.
This project is a basic Todo app that allows users to create and manage their tasks. It follows clean architecture principles and uses GetX for state management and dependency injection.
- Create new tasks
- Mark tasks as complete/incomplete
- Delete tasks
- Persistent storage
- Clean architecture
- Unit tests
- GetX: State management, dependency injection, and navigation
- Flutter Secure Storage: Secure storage for todos
- Mocktail: Mocking library for testing
The project follows a clean architecture structure and is organized into the following main directories:
├───lib/
│ ├───core/
│ │ ├───constants/
│ │ ├───utils/
│ │ └───extensions/
│ │───infrastructure/
│ │ ├───data/
│ │ │ │ └───local_todo_data_source.dart
│ │ │ └───repositories/
│ │ │ ├───todo_repository_impl.dart
│ │ │ └───todo_repository.dart
│ │ └───navigation/
│ │ └───routes.dart
│ ├───domain/
│ │ ├───entities/
│ │ │ └───todo_model.dart
│ │ └───uses_cases/
│ │ ├───add_todo_use_case.dart
│ │ ├───get_todo_use_case.dart
│ │ ├───save_todos_use_case.dart
│ │ └───toggle_complete_todo_use_case.dart
│ └───presentation/
│ ├───bindings/
│ │ └───todo_bindings.dart
│ ├───controllers/
│ │ ├───loading.controller.dart
│ │ └───todo.controller.dart
│ ├───pages/
│ │ ├───home_page.dart
│ │ └───main.dart
│ └───widgets/
│ └───todo_list_item_widget.dart
├───test/
│ └───todo_controller_test.dart
├───pubspec.yaml
└───README.md
domain
: Contains entities, use cases, and repository interfacesdata
: Contains repository implementations and data sourcespresentation
: Contains UI-related code, including widgets, controllers, and viewscore
: Contains utility classes, constants, and other shared codeinfrastructure
: Contains data, and navigation code
The app uses the following use cases:
AddTodoUseCase
: Add a new task to the listGetTodosUseCase
: Retrieve all tasks from storageSaveTodosUseCase
: Save all tasks to storageToggleCompleteTodoUseCase
: Mark a task as complete/incomplete
- Clone the repository:
bashCopy code
git clone https://github.com/yourusername/simple_todo_app.git
- Change directory to the project root:
bashCopy code
cd simple_todo_app
- Install dependencies:
csharpCopy code
flutter pub get
- Run the app on an emulator or a physical device:
Copy code
flutter run
Feel free to contribute to this project by opening issues, submitting pull requests, or providing feedback. Your contributions are always welcome!