Skip to content

Commit 9a8972f

Browse files
committed
Sync with latest master changes
- Fix fetchDataByUUID and return HealthDataPoint - Fix writeHealthData to return HealthDataPoint - Fix writeBloodOxygen to return HealthDataPoint - Revert pubspec.yaml to original
1 parent b9f9049 commit 9a8972f

7 files changed

Lines changed: 515 additions & 241 deletions

File tree

packages/health/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,22 @@ flutter: Health Plugin Error:
270270
flutter: PlatformException(FlutterHealth, Results are null, Optional(Error Domain=com.apple.healthkit Code=6 "Protected health data is inaccessible" UserInfo={NSLocalizedDescription=Protected health data is inaccessible}))
271271
```
272272

273+
### Fetch single health data by UUID
274+
275+
In order to retrieve a single record, it is required to provide `String uuid` and `HealthDataType type`.
276+
277+
Please see example below:
278+
```dart
279+
HealthDataPoint? healthPoint = await health.getHealthDataByUUID(
280+
uuid: 'random-uuid-string',
281+
type: HealthDataType.STEPS,
282+
);
283+
```
284+
```
285+
I/FLUTTER_HEALTH( 9161): Success: {uuid=random-uuid-string, value=12, date_from=1742259061009, date_to=1742259092888, source_id=, source_name=com.google.android.apps.fitness, recording_method=0}
286+
```
287+
> Assuming that the `uuid` and `type` are coming from your database.
288+
273289
### Filtering by recording method
274290

275291
Google Health Connect and Apple HealthKit both provide ways to distinguish samples collected "automatically" and manually entered data by the user.

0 commit comments

Comments
 (0)