Health
Read and write health and fitness data from Apple Health on iOS and Google Health Connect on Android with one Flutter API.
The health plugin gives Flutter apps one API for reading and writing health and fitness data on both mobile platforms:
- iOS: Apple Health, through Apple's HealthKit framework.
- Android: Google Health Connect.
Typical use cases:
| App type | Typical data |
|---|---|
| Fitness | Workouts, steps, calories, activity levels |
| Health monitoring | Vital signs such as heart rate, blood pressure and oxygen levels |
| Wellness | Sleep, mindfulness, water intake, daily activities |
| Medical | Blood glucose, medications, symptoms, health measurements |
Features
Reading data
- Read individual data points.
- Get time-bucketed aggregates (hourly, daily, weekly).
- Fetch workout summaries.
- Calculate step totals.
See Reading data.
Writing data
- Write numeric health data.
- Save workout sessions.
- Log meals with nutrition information.
- Record specialized data, such as ECG and audiograms.
See Writing data.
Permissions
- Request granular permissions per data type.
- Check permission status.
- Handle read and write access separately.
- Use the platform-specific permission flows.
See Permissions.
Supported data
The plugin supports over 100 health data types, including:
| Category | Data |
|---|---|
| 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 |
For every type, its unit and its platform availability, see Data types.
Platform support
| Platform | Health store | Minimum version |
|---|---|---|
| iOS | Apple Health (HealthKit) | iOS 13.0 |
| Android | Google Health Connect | Android API level 26 |
Each platform needs its own configuration before you use the plugin:
Android setup
iOS setup
How it works
Set up your project
Add the plugin to your
pubspec.yamland configure the platform-specific settings. See Installation.Request permissions
Ask the user for permission to access specific health data types. See Permissions.
Read or write data
Use the
HealthAPI to read existing data or write new measurements. See Reading data and Writing data.
Example
Configure the plugin, request permission and read today's step count:
For a complete working implementation with UI, see the example app.