Skip to content

Commit

Permalink
2.1.0 preps
Browse files Browse the repository at this point in the history
- update the HealthKitReporter to 2.0.0
  • Loading branch information
kvs-coder committed Oct 30, 2022
1 parent 5aa29f1 commit 2e1d4e8
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.1.0] - 30.10.2022

* Add new types for iOS 16 (also missing for iOS 15)

## [2.0.4] - 27.05.2022

* Add Correlation samples writing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A Flutter wrapper for [HealthKitReporter](https://cocoapods.org/pods/HealthKitRe
- Add this to your package's pubspec.yaml file:
``` Dart
dependencies:
health_kit_reporter: ^2.0.4
health_kit_reporter: ^2.1.0
```
- Get dependencies

Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ PODS:
- Flutter (1.0.0)
- flutter_local_notifications (0.0.1):
- Flutter
- health_kit_reporter (2.0.4):
- health_kit_reporter (2.1.0):
- Flutter
- HealthKitReporter
- HealthKitReporter (1.6.9)
- HealthKitReporter (2.0.0)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -27,8 +27,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
health_kit_reporter: d88d6d571215f7eaf4dc7412e551e139080681cd
HealthKitReporter: 655b234e8e6e6097fe5f05c27e67df5a99771501
health_kit_reporter: c42352ae9e6ba3035618f27aec723833487ceab3
HealthKitReporter: 85bbd047c01cf75fe8958de380048363c31b48d8

PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
21 changes: 21 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,31 @@ class _ReadView extends StatelessWidget with HealthKitReporterMixin {
queryActivitySummary();
},
child: Text('activitySummary')),
TextButton(
onPressed: () {
multipleQuery();
},
child: Text('multipleQuery')),
],
);
}

void multipleQuery() async {
final prefUnits =
await HealthKitReporter.preferredUnits([QuantityType.heartRate]);
final hrUnits = prefUnits.first.unit;

final now = DateTime.now();

for (int _ in List.generate(10, (index) => index + 1)) {
final hbQuery = await HealthKitReporter.quantityQuery(
QuantityType.heartRate,
hrUnits,
Predicate(now.subtract(Duration(seconds: 120 * 60 * 24)), now));
print(hbQuery.map((e) => e.harmonized.value));
}
}

void querySamples() async {
try {
final samples = await HealthKitReporter.sampleQuery(
Expand Down
25 changes: 9 additions & 16 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.0"
version: "2.0.4"
matcher:
dependency: transitive
description:
Expand All @@ -101,7 +101,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -115,7 +115,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
platform:
dependency: transitive
description:
Expand All @@ -141,7 +141,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -176,28 +176,21 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
timezone:
dependency: transitive
description:
name: timezone
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"
2 changes: 1 addition & 1 deletion ios/health_kit_reporter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'health_kit_reporter'
s.version = '2.0.4'
s.version = '2.1.0'
s.summary = 'HealthKitReporter. A wrapper for HealthKit framework. A Flutter plugin'
s.swift_versions = '5.3'
s.description = 'Helps to write or read data from Apple Health via HealthKit framework using Flutter.'
Expand Down
21 changes: 21 additions & 0 deletions lib/model/type/category_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ enum CategoryType {
vaginalDryness,
vomiting,
wheezing,
pregnancyTestResult,
progesteroneTestResult,
persistentIntermenstrualBleeding,
prolongedMenstrualPeriods,
irregularMenstrualCycles,
infrequentMenstrualCycles,
appleWalkingSteadinessEvent,
}

extension CategoryTypeIdentifier on CategoryType {
Expand Down Expand Up @@ -192,6 +199,20 @@ extension CategoryTypeIdentifier on CategoryType {
return 'HKCategoryTypeIdentifierVomiting';
case CategoryType.wheezing:
return 'HKCategoryTypeIdentifierWheezing';
case CategoryType.pregnancyTestResult:
return 'HKCategoryTypeIdentifierPregnancyTestResult';
case CategoryType.progesteroneTestResult:
return 'HKCategoryTypeIdentifierProgesteroneTestResult';
case CategoryType.persistentIntermenstrualBleeding:
return 'HKCategoryTypeIdentifierPersistentIntermenstrualBleeding';
case CategoryType.prolongedMenstrualPeriods:
return 'HKCategoryTypeIdentifierProlongedMenstrualPeriods';
case CategoryType.irregularMenstrualCycles:
return 'HKCategoryTypeIdentifierIrregularMenstrualCycles';
case CategoryType.infrequentMenstrualCycles:
return 'HKCategoryTypeIdentifierInfrequentMenstrualCycles';
case CategoryType.appleWalkingSteadinessEvent:
return 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent';
}
}
}
Expand Down
39 changes: 39 additions & 0 deletions lib/model/type/quantity_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ enum QuantityType {
dietaryCaffeine,
dietaryWater,
uvExposure,
appleMoveTime,
appleWalkingSteadiness,
appleSleepingWristTemperature,
runningStrideLength,
runningVerticalOscillation,
runningGroundContactTime,
runningPower,
runningSpeed,
heartRateRecoveryOneMinute,
numberOfAlcoholicBeverages,
atrialFibrillationBurden,
underwaterDepth,
waterTemperature,
}

extension QuantityTypeIdentifier on QuantityType {
Expand Down Expand Up @@ -285,6 +298,32 @@ extension QuantityTypeIdentifier on QuantityType {
return 'HKQuantityTypeIdentifierDietaryCaffeine';
case QuantityType.uvExposure:
return 'HKQuantityTypeIdentifierUVExposure';
case QuantityType.appleMoveTime:
return 'HKQuantityTypeIdentifierAppleMoveTime';
case QuantityType.appleWalkingSteadiness:
return 'HKQuantityTypeIdentifierAppleWalkingSteadiness';
case QuantityType.appleSleepingWristTemperature:
return 'HKQuantityTypeIdentifierAppleSleepingWristTemperature';
case QuantityType.runningStrideLength:
return 'HKQuantityTypeIdentifierRunningStrideLength';
case QuantityType.runningVerticalOscillation:
return 'HKQuantityTypeIdentifierRunningVerticalOscillation';
case QuantityType.runningGroundContactTime:
return 'HKQuantityTypeIdentifierRunningGroundContactTime';
case QuantityType.runningPower:
return 'HKQuantityTypeIdentifierRunningPower';
case QuantityType.runningSpeed:
return 'HKQuantityTypeIdentifierRunningSpeed';
case QuantityType.heartRateRecoveryOneMinute:
return 'HKQuantityTypeIdentifierHeartRateRecoveryOneMinute';
case QuantityType.numberOfAlcoholicBeverages:
return 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages';
case QuantityType.atrialFibrillationBurden:
return 'HKQuantityTypeIdentifierAtrialFibrillationBurden';
case QuantityType.underwaterDepth:
return 'HKQuantityTypeIdentifierUnderwaterDepth';
case QuantityType.waterTemperature:
return 'HKQuantityTypeIdentifierWaterTemperature';
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions lib/model/type/vision_prescription_type.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// Equivalent of [VisionPrescriptionType]
/// from [HealthKitReporter] https://cocoapods.org/pods/HealthKitReporter
///
/// Supports [identifier] extension representing
/// original [String] of the type.
///
enum VisionPrescriptionType {
visionPrescription,
}

extension VisionPrescriptionTypeIdentifier on VisionPrescriptionType {
String get identifier {
switch (this) {
case VisionPrescriptionType.visionPrescription:
return 'HKVisionPrescriptionTypeIdentifier';
}
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: health_kit_reporter
description: Helps to write or read data from Apple Health via HealthKit framework.
version: 2.0.4
version: 2.1.0
homepage: https://github.com/VictorKachalov/health_kit_reporter

environment:
Expand Down

0 comments on commit 2e1d4e8

Please sign in to comment.