Skip to content
GUIDE · UNIFIED WORKFLOW

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.

dart
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

ConcernAndroidiOSUnified surface
Health storeHealth ConnectHealthKitHealthConnector
Data modelHealth Connect recordsHealthKit samplesTyped health records
PermissionsRead/write grantsHealthKit authorizationTyped permissions
ChangesChange tokensAnchored queriesIncremental sync
UnitsPlatform unitsHKUnitDart 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

Released under the Apache 2.0 License.