health
13.3.2, released 3 months ago by carp.dk
Wrapper for Apple's HealthKit and Google's Health Connect.
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.
- health_connector_hc_android
Android implementation of the health_connector plugin using Health Connect SDK.
75Compare - open_wearables_health_sdk
Flutter SDK for background health data sync from Apple HealthKit and Samsung/Health Connect.
74Compare - health_kit_reporter
Flutter wrapper for Apple Health through HealthKit and Swift Package Manager.
80Compare - health_connector
Flutter health SDK for iOS HealthKit and Android Health Connect integration.
80Compare
Works with
Packages commonly used together with health: ones it builds on, ones built on it, and its own family.
- json_annotationhealth depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- intlhealth depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- device_info_plushealth depends on itProvides detailed information about the current device, make, model, and OS version.
- carp_serializablehealth depends on itPolymorphic JSON (de)serialization using json_serializable with type info.
- research_packageSame familyA Flutter framework for obtaining informed consent, showing surveys and collecting results.
- carp_mobile_sensingSame familyMobile sensing framework for collecting sensor and device data via configurable probes.
- mobility_featuresSame familyCalculates real-time mobility features like places, stops, and home stay from location data.
- carp_health_packageBuilt on healthSamples health data from Apple Health and Google Health Connect for CARP Mobile Sensing.