Skip to content

Conversation

marcos-abreu
Copy link

Summary

This PR fixes a mismatch between the keys returned by the native Android implementation and those expected by the Dart layer when creating a WorkoutSummary.

Problem

  • The Android layer returns workout properties in camelCase (totalDistance, totalEnergyBurned, etc.).
  • The Dart layer was expecting snake_case (total_distance, total_energy_burned, etc.).
  • The iOS layer returned both camelCase and snake_case.

This mismatch caused WorkoutSummary values to be unavailable when reading workouts from Android.

Changes

  • Updated Dart’s WorkoutSummary.fromHealthDataPoint and related checks to use camelCase keys (matching Android and also iOS).
  • Removed the duplicate snake_case properties from iOS (workout_type, total_distance, total_energy_burned).
  • Ensured consistency between Android, iOS, and Dart layers.

Impact

  • Fixes WorkoutSummary parsing for Android.
  • Cleans up unused keys from iOS without changing Dart’s expectations.
  • No breaking change for public Dart API (users continue to consume WorkoutSummary the same way).

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