Skip to content

Add HealthService for managing health data and caching mechanisms#79

Merged
Jozys merged 1 commit intomainfrom
feat/caching
Apr 6, 2025
Merged

Add HealthService for managing health data and caching mechanisms#79
Jozys merged 1 commit intomainfrom
feat/caching

Conversation

@Jozys
Copy link
Copy Markdown
Collaborator

@Jozys Jozys commented Apr 6, 2025

This pull request includes significant changes to the health data handling and device information retrieval in the repository. The most important changes involve refactoring the BaseLocalHealthImpl class, updating the DeviceInfoRepositoryImpl class, and modifying the StreakRepositoryImpl class to use a new health service.

Refactoring and improvements to health data handling:

  • lib/data/repositories/base_local_health_impl.dart: Introduced the BaseLocalHealthRepoImpl class with improved methods for fetching health data, handling overlaps, and writing tracking data to health. This includes methods like getHealthDataInInterval, getDistanceOfWorkoutsInInterval, and writeTrackingToHealth.
  • lib/data/repositories/local_health_impl.dart: Removed the old LocalHealthRepoImpl class and its methods, which have been replaced by the new BaseLocalHealthRepoImpl class.

Updates to device information retrieval:

Modifications to streak repository:

  • Replace current local_health_impl.dart with a new caching approach
  • Add healthService, that either requests flutter health data from local_health or returns the cached data

- Replace current local_health_impl.dart with a new caching approach
- Add healthService, that either requests flutter health data from local_health or returns the cached data
@Jozys Jozys added the enhancement New feature or request label Apr 6, 2025
@Jozys Jozys requested a review from ScreepCode April 6, 2025 00:01
@Jozys Jozys self-assigned this Apr 6, 2025
Copy link
Copy Markdown
Owner

@ScreepCode ScreepCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems very good and useful :)

Note: We should implement an clearCache to the debug settings, mentioned in #81

@Jozys Jozys merged commit a70b633 into main Apr 6, 2025
1 check passed
@ScreepCode ScreepCode deleted the feat/caching branch April 6, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants