Skip to content

Overview

The Flutter Health Plugin is a cross-platform solution for accessing health and fitness data in your Flutter apps. It provides a unified API that works seamlessly with:

Apple Health (iOS)

Apple Health

Access health data on iOS devices through Apple’s native HealthKit framework

Google Health Connect (Android)

Google Health Connect

Read and write health data on Android using Google Health Connect

Fitness Apps

Track workouts, steps, calories, and activity levels

Health Monitoring

Monitor vital signs like heart rate, blood pressure, and oxygen levels

Wellness Apps

Track sleep, mindfulness, water intake, and daily activities

Medical Apps

Record blood glucose, medications, symptoms, and health measurements

Flexible Data Queries

  • Read individual data points
  • Get time-bucketed aggregates (hourly, daily, weekly)
  • Fetch workout summaries
  • Calculate step totals
// Get last 24 hours of step data
final data = await health.getHealthDataFromTypes(
types: [HealthDataType.STEPS],
startDate: yesterday,
endDate: now,
);
  1. Setup Your Project

    Add the plugin to your pubspec.yaml and configure platform-specific settings

    Go to Installation →

  2. Request Permissions

    Ask users for permission to access specific health data types

    Learn about Permissions →

  3. Read or Write Data

    Use the Health API to read existing data or write new measurements

    Reading Guide → | Writing Guide →

Here’s a complete example to get you started:

import 'package:health/health.dart';
// 1. Create Health instance
final health = Health();
await health.configure();
// 2. Request permissions
final types = [HealthDataType.STEPS];
final granted = await health.requestAuthorization(types);
if (granted) {
// 3. Read today's steps
final now = DateTime.now();
final midnight = DateTime(now.year, now.month, now.day);
final steps = await health.getTotalStepsInInterval(midnight, now);
print('Steps today: ${steps ?? 0}');
}

The plugin supports over 100 health data types including:

Activity

Steps, distance, calories, workouts, flights climbed

Body Measurements

Weight, height, BMI, body fat %, lean mass

Vital Signs

Heart rate, blood pressure, blood oxygen, temperature

Nutrition

Meals, water, calories, macros, micronutrients

Sleep

Sleep stages, in bed time, asleep time, REM, deep sleep

Reproductive

Menstruation flow, cycle tracking

See all data types →

Before using the plugin, you need to configure each platform: