health_kit_reporter icon indicating copy to clipboard operation
health_kit_reporter copied to clipboard

Workout metadata missing.

Open ShineYang opened this issue 1 year ago • 2 comments

Describe the bug When I use HealthKitReporter.workoutQuery(predicate) to retrieve workout data, harmonized.metadata always returns null.

To Reproduce try { final workouts = await HealthKitReporter.workoutQuery(predicate); workouts.forEach((element) { print('metadata: ${element.harmonized.metadata}'); }); } catch (e) { print(e); }

Expected behavior The metadata should look like this: {HKAverageMETs: 4.85739 kcal/hr·kg, HKIndoorWorkout: 0, HKWeatherTemperature: 52.016 degF, HKWeatherHumidity: 7600 %, HKTimeZone: Asia/Shanghai, HKElevationAscended: 2403 cm}

Additional context I think the reason might be that there's something wrong with Metadata.make()in the native code.

ShineYang avatar Apr 03 '23 12:04 ShineYang

Hoping for this fix.. need elevation gain for my existing project

jeybs avatar Sep 07 '23 10:09 jeybs

I have solution....for workout. i can use substrac 1 seconds for startDate and add 1 seconds for endDate.!

Regards!

appsowner avatar Sep 15 '23 00:09 appsowner