Skip to content
pubscout

health_kit_reporter

3.0.0, released 6 weeks ago by victorkachalov.com

Flutter wrapper for Apple Health through HealthKit and Swift Package Manager.

WASM-ready
$ flutter pub add health_kit_reporter
Source repository

What it does

Reads, writes, and observes Apple Health data on iOS by wrapping the Swift library HealthKitReporter. Parses all payloads from JSON into typed Dart models.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read or write Apple Health data in a Flutter iOS application.
  • You want to observe data changes or handle clinical records and workouts.

Skip it when

  • Your app targets Android or platforms other than iOS where Apple Health is unavailable.
  • You want to use CocoaPods instead of Swift Package Manager.

Strengths

  • Comprehensive coverage of HealthKit features including clinical records, workouts, and queries.
  • Maintains up-to-date parity with the HealthKitReporter Swift library.

Weaknesses

  • iOS only, requiring manual configuration of capabilities, entitlements, and usage descriptions.
  • Requires Swift Package Manager and iOS 15 or newer.

Setup

Kind
Plugin (native code)
Effort
High
Code generation
No
Direct dependencies
0

Requires enabling Swift Package Manager in Flutter, setting iOS deployment target to 15.0 or newer, configuring HealthKit capabilities and entitlements in Xcode, and adding usage descriptions to Info.plist.

Future<bool> requestAuthorization() async {
  final readTypes = QuantityType.values.map((e) => e.identifier).toList();
  final writeTypes = <String>[];
  for (final identifier in readTypes) {
    if (await HealthKitReporter.isWritable(identifier)) {
      writeTypes.add(identifier);
    }
  }
  return HealthKitReporter.requestAuthorization(readTypes, writeTypes);
}

Alternatives

Packages that do the same job and could replace health_kit_reporter.