Introduction
Health Connector is a production-grade Flutter SDK that presents Android Health Connect and iOS HealthKit through one strongly typed Dart API.
The platforms differ in data models, permissions, feature availability, and privacy behavior. Health Connector keeps those differences explicit where they matter while giving application code a consistent workflow for reading, writing, updating, deleting, aggregating, and synchronizing health records.
Why Health Connector
A shared domain model
Use the same record and measurement types on both platforms. A WeightRecord carries Mass; a HeartRateSeriesRecord carries Frequency samples. Invalid pairings are caught by the Dart compiler rather than during a user session.
Capabilities at the type level
Each HealthDataType exposes only the operations supported by that record type. Read requests return the matching record type automatically, so application code does not need runtime casts.
final request = HealthDataType.weight.readInTimeRange(
startTime: DateTime.now().subtract(const Duration(days: 30)),
endTime: DateTime.now(),
);
final response = await connector.readRecords(request);
// Inferred as List<WeightRecord>.
final records = response.records;Privacy-first behavior
The SDK logs nothing by default. Permission requests stay explicit, native platform behavior is preserved, and opt-in log processors give your app control over where diagnostic data goes.
Platform bridge
| Concern | Android | iOS | Unified surface |
|---|---|---|---|
| Health store | Health Connect | HealthKit | HealthConnector |
| Data model | Health Connect records | HealthKit samples | Typed health records |
| Permissions | Read/write grants | HealthKit authorization | Typed permissions |
| Changes | Change tokens | Anchored queries | Incremental sync |
| Units | Platform units | HKUnit | Dart measurement units |
Platform-specific limitations are documented instead of hidden. For example, HealthKit does not reveal whether read access was denied, so iOS read permission status is reported as unknown by design.
Where to go next
- Follow Installation to configure both native platforms.
- Build an end-to-end flow in Quick start.
- Learn the data model in Health records.
- Browse the public API on pub.dev.