Skip to content

Commit 2e1d4e8

Browse files
committed
2.1.0 preps
- update the HealthKitReporter to 2.0.0
1 parent 5aa29f1 commit 2e1d4e8

11 files changed

+120
-24
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.1.0] - 30.10.2022
2+
3+
* Add new types for iOS 16 (also missing for iOS 15)
4+
15
## [2.0.4] - 27.05.2022
26

37
* Add Correlation samples writing

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A Flutter wrapper for [HealthKitReporter](https://cocoapods.org/pods/HealthKitRe
1616
- Add this to your package's pubspec.yaml file:
1717
``` Dart
1818
dependencies:
19-
health_kit_reporter: ^2.0.4
19+
health_kit_reporter: ^2.1.0
2020
```
2121
- Get dependencies
2222

example/ios/Podfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ PODS:
22
- Flutter (1.0.0)
33
- flutter_local_notifications (0.0.1):
44
- Flutter
5-
- health_kit_reporter (2.0.4):
5+
- health_kit_reporter (2.1.0):
66
- Flutter
77
- HealthKitReporter
8-
- HealthKitReporter (1.6.9)
8+
- HealthKitReporter (2.0.0)
99

1010
DEPENDENCIES:
1111
- Flutter (from `Flutter`)
@@ -27,8 +27,8 @@ EXTERNAL SOURCES:
2727
SPEC CHECKSUMS:
2828
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
2929
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
30-
health_kit_reporter: d88d6d571215f7eaf4dc7412e551e139080681cd
31-
HealthKitReporter: 655b234e8e6e6097fe5f05c27e67df5a99771501
30+
health_kit_reporter: c42352ae9e6ba3035618f27aec723833487ceab3
31+
HealthKitReporter: 85bbd047c01cf75fe8958de380048363c31b48d8
3232

3333
PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa
3434

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1220"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/lib/main.dart

+21
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,31 @@ class _ReadView extends StatelessWidget with HealthKitReporterMixin {
228228
queryActivitySummary();
229229
},
230230
child: Text('activitySummary')),
231+
TextButton(
232+
onPressed: () {
233+
multipleQuery();
234+
},
235+
child: Text('multipleQuery')),
231236
],
232237
);
233238
}
234239

240+
void multipleQuery() async {
241+
final prefUnits =
242+
await HealthKitReporter.preferredUnits([QuantityType.heartRate]);
243+
final hrUnits = prefUnits.first.unit;
244+
245+
final now = DateTime.now();
246+
247+
for (int _ in List.generate(10, (index) => index + 1)) {
248+
final hbQuery = await HealthKitReporter.quantityQuery(
249+
QuantityType.heartRate,
250+
hrUnits,
251+
Predicate(now.subtract(Duration(seconds: 120 * 60 * 24)), now));
252+
print(hbQuery.map((e) => e.harmonized.value));
253+
}
254+
}
255+
235256
void querySamples() async {
236257
try {
237258
final samples = await HealthKitReporter.sampleQuery(

example/pubspec.lock

+9-16
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ packages:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0"
45+
version: "1.16.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
@@ -56,7 +56,7 @@ packages:
5656
name: fake_async
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.2.0"
59+
version: "1.3.0"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -87,7 +87,7 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "2.0.0"
90+
version: "2.0.4"
9191
matcher:
9292
dependency: transitive
9393
description:
@@ -101,7 +101,7 @@ packages:
101101
name: material_color_utilities
102102
url: "https://pub.dartlang.org"
103103
source: hosted
104-
version: "0.1.3"
104+
version: "0.1.4"
105105
meta:
106106
dependency: transitive
107107
description:
@@ -115,7 +115,7 @@ packages:
115115
name: path
116116
url: "https://pub.dartlang.org"
117117
source: hosted
118-
version: "1.8.0"
118+
version: "1.8.1"
119119
platform:
120120
dependency: transitive
121121
description:
@@ -141,7 +141,7 @@ packages:
141141
name: source_span
142142
url: "https://pub.dartlang.org"
143143
source: hosted
144-
version: "1.8.1"
144+
version: "1.8.2"
145145
stack_trace:
146146
dependency: transitive
147147
description:
@@ -176,28 +176,21 @@ packages:
176176
name: test_api
177177
url: "https://pub.dartlang.org"
178178
source: hosted
179-
version: "0.4.8"
179+
version: "0.4.9"
180180
timezone:
181181
dependency: transitive
182182
description:
183183
name: timezone
184184
url: "https://pub.dartlang.org"
185185
source: hosted
186186
version: "0.7.0"
187-
typed_data:
188-
dependency: transitive
189-
description:
190-
name: typed_data
191-
url: "https://pub.dartlang.org"
192-
source: hosted
193-
version: "1.3.0"
194187
vector_math:
195188
dependency: transitive
196189
description:
197190
name: vector_math
198191
url: "https://pub.dartlang.org"
199192
source: hosted
200-
version: "2.1.1"
193+
version: "2.1.2"
201194
sdks:
202-
dart: ">=2.14.0 <3.0.0"
195+
dart: ">=2.17.0-0 <3.0.0"
203196
flutter: ">=1.20.0"

ios/health_kit_reporter.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'health_kit_reporter'
7-
s.version = '2.0.4'
7+
s.version = '2.1.0'
88
s.summary = 'HealthKitReporter. A wrapper for HealthKit framework. A Flutter plugin'
99
s.swift_versions = '5.3'
1010
s.description = 'Helps to write or read data from Apple Health via HealthKit framework using Flutter.'

lib/model/type/category_type.dart

+21
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ enum CategoryType {
6969
vaginalDryness,
7070
vomiting,
7171
wheezing,
72+
pregnancyTestResult,
73+
progesteroneTestResult,
74+
persistentIntermenstrualBleeding,
75+
prolongedMenstrualPeriods,
76+
irregularMenstrualCycles,
77+
infrequentMenstrualCycles,
78+
appleWalkingSteadinessEvent,
7279
}
7380

7481
extension CategoryTypeIdentifier on CategoryType {
@@ -192,6 +199,20 @@ extension CategoryTypeIdentifier on CategoryType {
192199
return 'HKCategoryTypeIdentifierVomiting';
193200
case CategoryType.wheezing:
194201
return 'HKCategoryTypeIdentifierWheezing';
202+
case CategoryType.pregnancyTestResult:
203+
return 'HKCategoryTypeIdentifierPregnancyTestResult';
204+
case CategoryType.progesteroneTestResult:
205+
return 'HKCategoryTypeIdentifierProgesteroneTestResult';
206+
case CategoryType.persistentIntermenstrualBleeding:
207+
return 'HKCategoryTypeIdentifierPersistentIntermenstrualBleeding';
208+
case CategoryType.prolongedMenstrualPeriods:
209+
return 'HKCategoryTypeIdentifierProlongedMenstrualPeriods';
210+
case CategoryType.irregularMenstrualCycles:
211+
return 'HKCategoryTypeIdentifierIrregularMenstrualCycles';
212+
case CategoryType.infrequentMenstrualCycles:
213+
return 'HKCategoryTypeIdentifierInfrequentMenstrualCycles';
214+
case CategoryType.appleWalkingSteadinessEvent:
215+
return 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent';
195216
}
196217
}
197218
}

lib/model/type/quantity_type.dart

+39
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ enum QuantityType {
100100
dietaryCaffeine,
101101
dietaryWater,
102102
uvExposure,
103+
appleMoveTime,
104+
appleWalkingSteadiness,
105+
appleSleepingWristTemperature,
106+
runningStrideLength,
107+
runningVerticalOscillation,
108+
runningGroundContactTime,
109+
runningPower,
110+
runningSpeed,
111+
heartRateRecoveryOneMinute,
112+
numberOfAlcoholicBeverages,
113+
atrialFibrillationBurden,
114+
underwaterDepth,
115+
waterTemperature,
103116
}
104117

105118
extension QuantityTypeIdentifier on QuantityType {
@@ -285,6 +298,32 @@ extension QuantityTypeIdentifier on QuantityType {
285298
return 'HKQuantityTypeIdentifierDietaryCaffeine';
286299
case QuantityType.uvExposure:
287300
return 'HKQuantityTypeIdentifierUVExposure';
301+
case QuantityType.appleMoveTime:
302+
return 'HKQuantityTypeIdentifierAppleMoveTime';
303+
case QuantityType.appleWalkingSteadiness:
304+
return 'HKQuantityTypeIdentifierAppleWalkingSteadiness';
305+
case QuantityType.appleSleepingWristTemperature:
306+
return 'HKQuantityTypeIdentifierAppleSleepingWristTemperature';
307+
case QuantityType.runningStrideLength:
308+
return 'HKQuantityTypeIdentifierRunningStrideLength';
309+
case QuantityType.runningVerticalOscillation:
310+
return 'HKQuantityTypeIdentifierRunningVerticalOscillation';
311+
case QuantityType.runningGroundContactTime:
312+
return 'HKQuantityTypeIdentifierRunningGroundContactTime';
313+
case QuantityType.runningPower:
314+
return 'HKQuantityTypeIdentifierRunningPower';
315+
case QuantityType.runningSpeed:
316+
return 'HKQuantityTypeIdentifierRunningSpeed';
317+
case QuantityType.heartRateRecoveryOneMinute:
318+
return 'HKQuantityTypeIdentifierHeartRateRecoveryOneMinute';
319+
case QuantityType.numberOfAlcoholicBeverages:
320+
return 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages';
321+
case QuantityType.atrialFibrillationBurden:
322+
return 'HKQuantityTypeIdentifierAtrialFibrillationBurden';
323+
case QuantityType.underwaterDepth:
324+
return 'HKQuantityTypeIdentifierUnderwaterDepth';
325+
case QuantityType.waterTemperature:
326+
return 'HKQuantityTypeIdentifierWaterTemperature';
288327
}
289328
}
290329
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// Equivalent of [VisionPrescriptionType]
2+
/// from [HealthKitReporter] https://cocoapods.org/pods/HealthKitReporter
3+
///
4+
/// Supports [identifier] extension representing
5+
/// original [String] of the type.
6+
///
7+
enum VisionPrescriptionType {
8+
visionPrescription,
9+
}
10+
11+
extension VisionPrescriptionTypeIdentifier on VisionPrescriptionType {
12+
String get identifier {
13+
switch (this) {
14+
case VisionPrescriptionType.visionPrescription:
15+
return 'HKVisionPrescriptionTypeIdentifier';
16+
}
17+
}
18+
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: health_kit_reporter
22
description: Helps to write or read data from Apple Health via HealthKit framework.
3-
version: 2.0.4
3+
version: 2.1.0
44
homepage: https://github.com/VictorKachalov/health_kit_reporter
55

66
environment:

0 commit comments

Comments
 (0)