Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use riverpod for task progress bar #1866

Merged
merged 2 commits into from
Dec 8, 2024

Conversation

matthiasn
Copy link
Owner

This pull request includes various changes aimed at improving the codebase by removing unused imports, refactoring existing classes, and introducing new state management for task progress. The most important changes include the removal of unused methods, the introduction of the TaskProgressState class, and the refactoring of the LinkedDuration widget to use Riverpod for state management.

Removal of Unused Methods and Imports:

  • Removed the watchLinkedTotalDuration method from the JournalDb class in lib/database/database.dart.
  • Removed unused imports in lib/database/database.dart and lib/features/journal/state/entry_controller.dart [1] [2].

Introduction of Task Progress State:

  • Added the TaskProgressState class to manage task progress and estimate durations in lib/features/tasks/model/task_progress_state.dart.
  • Generated code for TaskProgressState using Freezed in lib/features/tasks/model/task_progress_state.freezed.dart.

Refactoring for State Management:

  • Refactored the LinkedDuration widget to use Riverpod for state management, replacing the previous StreamBuilder implementation in lib/features/tasks/ui/linked_duration.dart [1] [2] [3].
  • Updated the TaskSliverAppBar to use the new LinkedDuration implementation in lib/features/tasks/ui/task_app_bar.dart.

Task Progress Controller:

  • Introduced the TaskProgressController class to manage task progress state in lib/features/tasks/state/task_progress_controller.dart.
  • Generated code for TaskProgressController using Riverpod in lib/features/tasks/state/task_progress_controller.g.dart.

Version Update:

  • Updated the version of the project in pubspec.yaml.

@matthiasn matthiasn merged commit 6600ff3 into main Dec 8, 2024
4 of 6 checks passed
@matthiasn matthiasn deleted the refactor/remove_stream_builders branch December 8, 2024 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant