Add dependency
Initialize the plugin
configure() resolves a stable device identifier and registers JSON factories. You can pass a custom DeviceInfoPlugin to Health() for testing.Request permissions when needed
ArgumentError for illegal combinations.Platform-specific setup
- Android: Health Connect permissions in
AndroidManifest.xml, activity recognition, optional history/background permissions, and Health Connect install flow. - iOS: Enable HealthKit capability and add
NSHealthShareUsageDescriptionandNSHealthUpdateUsageDescriptiontoInfo.plist.