Skip to content
pubscout

health

13.3.2, released 3 months ago by carp.dk

Wrapper for Apple's HealthKit and Google's Health Connect.

Rock solid
$ flutter pub add health
Source repository

What it does

Enables reading and writing health and fitness data from and to Apple Health on iOS and Google Health Connect on Android. Handles permissions, data types, workouts, and routes.

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

Use it when

  • You need to read or write fitness and health data in a Flutter app
  • You need integration with Apple HealthKit or Google Health Connect

Skip it when

  • You need support for the deprecated Google Fit API
  • Targeting iOS versions older than 15.0

Strengths

  • Supports both Apple Health and Google Health Connect
  • Provides extensive methods for handling health data, workouts, and routes

Weaknesses

  • Requires manual native setup and specific permissions in Info.plist and AndroidManifest.xml
  • Android target phone needs the Health Connect app installed

Setup

Kind
Plugin (native code)
Effort
High
Code generation
Yes (build_runner)
Direct dependencies
4

Requires adding permissions and HealthKit capabilities in Xcode for iOS, and specific queries, permissions, and extending FlutterFragmentActivity for Android.

final health = Health();
await health.configure();
var types = [HealthDataType.STEPS, HealthDataType.BLOOD_GLUCOSE];
bool requested = await health.requestAuthorization(types);
var now = DateTime.now();
List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(now.subtract(Duration(days: 1)), now, types);

Alternatives

Packages that do the same job and could replace health.

Works with

Packages commonly used together with health: ones it builds on, ones built on it, and its own family.