A task management application built with Flutter, demonstrating a clean MVVM (Model-View-ViewModel) architecture combined with MobX for reactive state management.
- Task Management: Create, Read, Update, and Delete tasks.
- Persistent Storage: Uses Hive for fast, local NoSQL database storage.
- Reactive UI: State management powered by MobX for automatic UI updates.
- Clean Architecture: Organized into features and core layers for scalability.
- Dependency Injection: Managed via the Provider package.
- Custom Routing: Centralized route management.
This project follows the MVVM design pattern:
- Model: Represents the data layer (Hive objects/JSON models).
- View: Flutter widgets that display the UI and observe the ViewModel.
- ViewModel: Contains business logic and uses MobX
@observableand@actionto manage state. - Repository: Acts as an intermediary between the ViewModel and Data Sources (Hive).
lib/
├── app/ # App-level config (Theme, Router)
├── core/ # Shared components
│ ├── base/ # Base classes (BaseViewModel)
│ ├── constants/ # App constants (App, Navigation)
│ └── utils/ # Database and UI utilities
└── features/ # Feature-based modules
└── task/ # Task feature
├── model/ # Data models
├── repository/ # Data abstraction layer
├── view/ # UI screens and widgets
└── viewmodel/ # MobX stores
- State Management: MobX & flutter_mobx
- Dependency Injection: Provider
- Database: Hive
- Code Generation: build_runner, mobx_codegen, hive_generator
-
Clone the repository:
git clone https://github.com/Sumat-Dev/flutter-mobx-mvvm-task-manager-guide.git
-
Install dependencies:
flutter pub get
-
Run Code Generation: Since this project uses MobX and Hive, you need to generate the necessary files:
flutter pub run build_runner build --delete-conflicting-outputs
-
Run the app:
flutter run
This project is licensed under the MIT License - see the LICENSE file for details.