How isaiascuvula/flutter_riverpod_todo_app works
Purpose and runtime
A Flutter mobile Todo application demonstrating Riverpod-managed CRUD state. Dart/Flutter owns application behavior and UI; native Android and iOS projects package and launch the Flutter runtime. No backend or external service is indicated.
Entry points:
• lib/main.dart initializes Flutter and the application.
• lib/app/app.dart defines the root app shell.
• android/app/src/main/kotlin/com/bersyte/flutter_riverpod_todo_app/MainActivity.kt
• ios/Runner/AppDelegate.swift
Application composition and navigation
The app layer combines route and theme configuration before rendering feature screens. Navigation is centralized rather than embedded solely in widgets.
• lib/app/app.dart
• lib/config/routes/app_routes.dart
• lib/config/routes/routes_provider.dart
• lib/config/theme/app_theme.dart
Primary screens are the task list/home view and task-creation flow:
• lib/screens/home_screen.dart
• lib/screens/create_task_screen.dart
• lib/screens/screens.dart
Task domain and persistence boundary
Task is the domain/data model. UI and state logic access tasks through a repository abstraction, which delegates to a datasource. This separates CRUD consumers from the concrete storage implementation and permits replacing the datasource without changing notifier or screen contracts.
• lib/data/models/task.dart
• lib/data/repositories/task_repository.dart
• lib/data/repositories/task_repository_impl.dart
• lib/data/datasource/task_datasource.dart
Provider wiring exposes the datasource and repository to Riverpod’s dependency graph:
• lib/data/datasource/task_datasource_provider.dart
• lib/data/repositories/task_repository_provider.dart
Riverpod task state flow
The task feature has a dedicated notifier/state/provider layer. Screens watch task providers; user actions invoke notifier CRUD operations; the notifier calls the repository and emits updated task state, causing dependent UI to rebuild.
• lib/providers/task/task_notifier.dart
• lib/providers/task/task_state.dart
• lib/providers/task/tasks_provider.dart
This is the central control-flow boundary: widgets should consume providers rather than directly manipulate datasource or repository implementations.
Filtering and task-input state
Independent providers hold task-selection criteria and input-related temporal state. These likely combine with the task list to drive category/date filtering and scheduling behavior without coupling that transient UI state to persistence.
• lib/providers/category_provider.dart
• lib/providers/date_provider.dart
• lib/providers/time_provider.dart
Task category vocabulary and common task constants live outside screen code:
• lib/utils/task_category.dart
• lib/utils/task_keys.dart
UI assembly
Reusable widgets compose screens and keep task presentation, details, selection controls, and visual containers separate from orchestration.
• lib/widgets/display_list_of_tasks.dart
• lib/widgets/task_tile.dart
• lib/widgets/task_details.dart
• lib/widgets/categories_selection.dart
• lib/widgets/select_date_time.dart
Typical rendering flow is: app/router → screen → Riverpod provider state → list/detail widgets. Create/edit interactions flow in reverse through notifier → repository → datasource → refreshed provider state.
Platform infrastructure
Flutter packages are declared in pubspec.yaml. Android uses Gradle and its manifest/application module; iOS uses CocoaPods/Xcode Runner infrastructure.
• pubspec.yaml
• android/app/build.gradle
• android/app/src/main/AndroidManifest.xml
• ios/Podfile
• ios/Runner/Info.plist
Main entry points: task_notifier.dart Task notifier · home_screen.dart Task list screen · create_task_screen.dart Create task screen · main.dart Flutter entry point
Components 20
Flutter application
- Flutter entry point
lib/main.dart - App shell
lib/app/app.dart - Routes and navigation
lib/config/routes/app_routes.dart - App theme
lib/config/theme/app_theme.dart - Task list screen
lib/screens/home_screen.dart - Create task screen
lib/screens/create_task_screen.dart - Task presentation widgets · List, tile, and detail widgets render task state.
lib/widgets/display_list_of_tasks.dart - Selection widgets · Category and date/time controls collect task input.
lib/widgets/categories_selection.dart
Task state and data
- Task provider
lib/providers/task/tasks_provider.dart - Task notifier · Executes task CRUD and emits refreshed state.
lib/providers/task/task_notifier.dart - Task state
lib/providers/task/task_state.dart - Filter and time providers · Category, date, and time selection state.
lib/providers/category_provider.dart - Task model
lib/data/models/task.dart - Task repository
lib/data/repositories/task_repository.dart - Repository implementation
lib/data/repositories/task_repository_impl.dart - Task datasource
lib/data/datasource/task_datasource.dart - Data provider wiring · Provides datasource and repository implementations.
lib/data/repositories/task_repository_provider.dart
Native packaging
- Android host
android/app/src/main/kotlin/com/bersyte/flutter_riverpod_todo_app/MainActivity.kt - iOS host
ios/Runner/AppDelegate.swift - Flutter packages
pubspec.yaml
Connections 25
- Android host → Flutter entry point: launches
- iOS host → Flutter entry point: launches
- Flutter packages → Flutter entry point: declares dependencies
- Flutter entry point → App shell: initializes
- App shell → Routes and navigation: configures
- App shell → App theme: applies
- Routes and navigation → Task list screen: navigates to
- Routes and navigation → Create task screen: navigates to
- Task list screen → Task provider: watches
- Task list screen → Filter and time providers: uses
- Task list screen → Task presentation widgets: composes
- Create task screen → Selection widgets: composes
- Create task screen → Filter and time providers: uses
- Create task screen → Task notifier: submits CRUD
- Task provider → Task notifier: exposes
- Task notifier → Task state: emits
- Task notifier → Task repository: uses
- Task repository → Task model: returns
- Repository implementation → Task repository: implements
- Repository implementation → Task datasource: delegates CRUD
- Task datasource → Task model: stores
- Data provider wiring → Repository implementation: provides
- Data provider wiring → Task datasource: provides
- Task notifier → Data provider wiring: resolves dependency
- Task provider → Task state: publishes