1
Add dependency
2
Initialize the plugin
configure() resolves a stable device identifier and registers JSON factories. You can pass a custom DeviceInfoPlugin to Health() for testing.3
Request permissions when needed
ArgumentError for illegal combinations.4
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.