Skip to content

Commit

Permalink
Merge pull request #22 from VictorKachalov/1.2.0-nullsafety
Browse files Browse the repository at this point in the history
1.2.0 nullsafety
  • Loading branch information
kvs-coder authored Apr 18, 2021
2 parents e35bd94 + d1dcdee commit f6ad22b
Show file tree
Hide file tree
Showing 62 changed files with 406 additions and 392 deletions.
41 changes: 20 additions & 21 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [1.3.0] - 18.04.2021

* Fix with reinitilizing subscriptions for Events
* Remove Android support

## [1.2.0-nullsafety.0] - 12.03.2021

* Null safety support

## [1.1.1] - 12.03.2021

* Anchored Query fix with deleted objects
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ A Flutter wrapper for [HealthKitReporter](https://cocoapods.org/pods/HealthKitRe
## Getting Started

- Go inside pubspec.yaml file
- Add this to your package's pubspec.yaml file:
- Add this to your package's pubspec.yaml file:
``` Dart
dependencies:
health_kit_reporter: ^1.1.1
health_kit_reporter: ^1.3.0
```
- Get dependencies

Expand Down
8 changes: 0 additions & 8 deletions android/.gitignore

This file was deleted.

43 changes: 0 additions & 43 deletions android/build.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions android/gradle.properties

This file was deleted.

5 changes: 0 additions & 5 deletions android/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

1 change: 0 additions & 1 deletion android/settings.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions android/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

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 (1.1.0):
- health_kit_reporter (1.1.1):
- Flutter
- HealthKitReporter
- HealthKitReporter (1.4.0)
- HealthKitReporter (1.4.2)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -27,8 +27,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
health_kit_reporter: 4f07356cf70fff8d50b92b76ee9beacf7e3d70f9
HealthKitReporter: 1bd60f53111044cc3a0d575d57dc4b23767c8ac6
health_kit_reporter: 9ac0e8b9d1933d67b23f1ee8e4d45eb4611bfe84
HealthKitReporter: 52c618d03c0544fc9d3ee09fcac81fb57a828a0f

PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa

Expand Down
44 changes: 25 additions & 19 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
observerQuery();
anchoredObjectQuery();
queryActivitySummaryUpdates();
statisticsCollectionQuery();
heartbeatSeriesQuery();
workoutRouteQuery();
final initializationSettingsIOs = IOSInitializationSettings();
final initSettings = InitializationSettings(iOS: initializationSettingsIOs);
_flutterLocalNotificationsPlugin.initialize(initSettings,
Expand Down Expand Up @@ -209,14 +203,28 @@ class _MyAppState extends State<MyApp> {
Text('OBSERVE'),
ElevatedButton(
onPressed: () {
observerQuery();
observerQuery(
QuantityType.stepCount.identifier);
},
child: Text('observerQuery')),
child: Text('observerQuery - STEPS')),
ElevatedButton(
onPressed: () {
anchoredObjectQuery();
observerQuery(
QuantityType.heartRate.identifier);
},
child: Text('anchoredObjectQuery')),
child: Text('observerQuery - HR')),
ElevatedButton(
onPressed: () {
anchoredObjectQuery(
QuantityType.stepCount.identifier);
},
child: Text('anchoredObjectQuery - STEPS')),
ElevatedButton(
onPressed: () {
anchoredObjectQuery(
QuantityType.heartRate.identifier);
},
child: Text('anchoredObjectQuery - HR')),
ElevatedButton(
onPressed: () {
queryActivitySummaryUpdates();
Expand Down Expand Up @@ -464,21 +472,20 @@ class _MyAppState extends State<MyApp> {
}
}

void observerQuery() async {
final identifier = QuantityType.stepCount.identifier;
void observerQuery(String identifier) async {
final sub = HealthKitReporter.observerQuery(identifier, _predicate,
onUpdate: (identifier) async {
print('Updates for observerQuerySub');
print('Updates for observerQuerySub - $identifier');
print(identifier);
final iOSDetails = IOSNotificationDetails();
final details = NotificationDetails(iOS: iOSDetails);
await _flutterLocalNotificationsPlugin.show(
0, 'Observer', identifier, details);
});
print('observerQuerySub: $sub');
print('$identifier observerQuerySub: $sub');
final isSet = await HealthKitReporter.enableBackgroundDelivery(
identifier, UpdateFrequency.immediate);
print('enableBackgroundDelivery: $isSet');
print('$identifier enableBackgroundDelivery: $isSet');
}

void heartbeatSeriesQuery() {
Expand All @@ -499,15 +506,14 @@ class _MyAppState extends State<MyApp> {
print('workoutRouteQuery: $sub');
}

void anchoredObjectQuery() {
final identifier = QuantityType.stepCount.identifier;
void anchoredObjectQuery(String identifier) {
final sub = HealthKitReporter.anchoredObjectQuery(identifier, _predicate,
onUpdate: (samples, deletedObjects) {
print('Updates for anchoredObjectQuerySub');
print('Updates for anchoredObjectQuerySub - $identifier');
print(samples.map((e) => e.map).toList());
print(deletedObjects.map((e) => e.map).toList());
});
print('anchoredObjectQuerySub: $sub');
print('$identifier anchoredObjectQuerySub: $sub');
}

void queryActivitySummaryUpdates() {
Expand Down
10 changes: 5 additions & 5 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ packages:
name: flutter_local_notifications
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0-nullsafety.0"
version: "5.0.0-nullsafety.1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety.2"
version: "3.0.0-nullsafety.4"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.0"
version: "1.2.0-nullsafety.0"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -129,7 +129,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "2.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -199,5 +199,5 @@ packages:
source: hosted
version: "2.1.0"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ description: Demonstrates how to use the health_kit_reporter plugin.
version: 1.0.0

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_local_notifications: ^5.0.0-nullsafety.0
flutter_local_notifications: ^5.0.0-nullsafety.1
health_kit_reporter:
# When depending on this package from a real application you should use:
# health_kit_reporter: ^x.y.z
Expand Down
5 changes: 2 additions & 3 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:health_kit_reporter_example/main.dart';

void main() {
Expand All @@ -18,8 +17,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data.startsWith('Running on:'),
(Widget widget) =>
widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
Loading

0 comments on commit f6ad22b

Please sign in to comment.