kvs-coder / health_kit_reporter

A Flutter wrapper for the HealthKitReporter library
https://pub.dev/packages/health_kit_reporter
MIT License
38 stars 38 forks source link

Samples are broken #24

Closed ollyde closed 3 years ago

ollyde commented 3 years ago

Samples from the docs.

final now = DateTime.now();
      final minuteAgo = now.add(Duration(minutes: -1));
      final device = Device('FlutterTracker', 'kvs', 'T-800', '3', '3.0', '1.1.1', 'kvs.f.t', '444-888-555');
      final source = Source('maApp', 'com.kvs.health_kit_reporter_example');
      final operatingSystem = OperatingSystem(1, 2, 3);
      final sourceRevision = SourceRevision(source, '5', 'fit', '4', operatingSystem);
      final harmonized = QuantityHarmonized(100, 'count', null);
      final steps = Quantity(
        QuantityType.activeEnergyBurned.identifier,
        minuteAgo.millisecondsSinceEpoch,
        now.millisecondsSinceEpoch,
        device,
        sourceRevision,
        harmonized,
      );
      print(steps.map);
Screenshot 2021-05-15 at 13 00 43
kvs-coder commented 3 years ago

Hi @ollydixon

Thank you, I have fixed the documentation, indeed, there was an old code. You can also try to use the "example" app as well to see how the package works