HealthKit class

Constructors

HealthKit()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hasPermissions(List<DataType> types) Future<bool>
iOS isn't completely supported by HealthKit, false means no, true means user has approved or declined permissions. In case user has declined permissions read will just return empty list for declined data types.
read(DataType type, {DateTime? dateFrom, DateTime? dateTo, int? limit}) Future<List<HealthData>?>?
It's not advised to call await HealthKit.read(dataType) without any extra parameters. This can lead to FAILED BINDER TRANSACTION on Android devices because of the data batch size being too large.
readLast(DataType type) Future<HealthData?>?
reads last value
requestPermissions(List<DataType> types) Future<bool>
If you're using more than one DataType it's advised to call requestPermissions with all the data types once, otherwise iOS HealthKit will ask to approve every permission one by one in separate screens.
revokePermissions() Future<void>
iOS isn't supported by HealthKit, method does nothing.