Skip to content

Add per-workout flights climbed and swimming stroke count - #495

Open
zkrige wants to merge 1 commit into
carp-dk:mainfrom
zkrige:add-flights-swim-strokes
Open

Add per-workout flights climbed and swimming stroke count#495
zkrige wants to merge 1 commit into
carp-dk:mainfrom
zkrige:add-flights-swim-strokes

Conversation

@zkrige

@zkrige zkrige commented May 31, 2026

Copy link
Copy Markdown

Summary

Exposes two per-workout HealthKit totals that were not previously surfaced by the plugin:

  • Flights climbed (HKWorkout.totalFlightsClimbed)
  • Swimming stroke count (HKWorkout.totalSwimmingStrokeCount)

Both are direct HKWorkout properties. The workout's duration (seconds) is also added to the emitted dictionary for completeness.

Changes

iOS (ios/Classes/HealthDataReader.swift) — both [HKWorkout] branches (the list read used by getHealthDataFromTypes and the single-sample read) now emit totalFlightsClimbed, totalSwimmingStrokeCount (in HKUnit.count(), null when the property is nil), and duration.

Dart (lib/src/health_value_types.dart)WorkoutHealthValue gains nullable int? totalFlightsClimbed and int? totalSwimmingStrokeCount fields, parsed in fromHealthDataPoint mirroring totalSteps/totalDistance, and wired into the constructor, toString, ==, and hashCode.

Generated (lib/health.g.dart) — regenerated via dart run build_runner build to include the new fields in JSON (de)serialization.

These are additive and nullable, so existing consumers are unaffected. Values are null on Android (HealthKit-only properties).

@zkrige zkrige closed this May 31, 2026
@zkrige
zkrige deleted the add-flights-swim-strokes branch May 31, 2026 15:23
@zkrige
zkrige restored the add-flights-swim-strokes branch May 31, 2026 15:24
@zkrige zkrige reopened this May 31, 2026
@zkrige zkrige closed this May 31, 2026
@zkrige
zkrige deleted the add-flights-swim-strokes branch May 31, 2026 15:34
@zkrige
zkrige restored the add-flights-swim-strokes branch May 31, 2026 15:38
@zkrige zkrige reopened this May 31, 2026
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