Skip to content

Conversation

klnfreedom
Copy link

This pull request introduces improved permission handling for health data retrieval on Android and adds support for capturing the raw workout activity type in the Dart data model. The main changes are grouped into Android permission checks and Dart model enhancements.

Android permission checks:

  • Added a new HealthPermissionChecker class to encapsulate permission checks for location, distance, calories burned, and steps in HealthPermissionChecker.kt.
  • Updated HealthDataReader.kt to use HealthPermissionChecker before attempting to read workout distance, calories burned, and steps; if permissions are missing, the retrieval is skipped and a log message is recorded. [1] [2] [3] [4] [5]
  • Changed error handling in HealthDataReader.kt to return a proper error result when data is unavailable, instead of returning null.

Dart model enhancements:

  • Added a new rawWorkoutActivityType field to the WorkoutHealthValue class in health_value_types.dart, storing the raw activity type from native data. Updated the constructor, factory, toString, equality, and hashCode methods to support this new field. [1] [2] [3] [4]

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