HealthFactory class

Main class for the Plugin.

The plugin supports:

Constructors

HealthFactory({bool useHealthConnectIfAvailable = false})

Properties

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

Methods

delete(HealthDataType type, DateTime startTime, DateTime endTime) Future<bool>
Deletes all records of the given type for a given period of time
getHealthDataFromTypes(DateTime startTime, DateTime endTime, List<HealthDataType> types) Future<List<HealthDataPoint>>
Fetch a list of health data points based on types.
getTotalStepsInInterval(DateTime startTime, DateTime endTime) Future<int?>
Get the total numbner of steps within a specific time period. Returns null if not successful.
hasPermissions(List<HealthDataType> types, {List<HealthDataAccess>? permissions}) Future<bool?>
Determines if the data types have been granted with the specified access rights.
isDataTypeAvailable(HealthDataType dataType) bool
Check if a given data type is available on the platform
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAuthorization(List<HealthDataType> types, {List<HealthDataAccess>? permissions}) Future<bool>
Requests permissions to access data types in Apple Health or Google Fit.
revokePermissions() Future<void>
Revokes permissions of all types. Uses disableFit() on Google Fit.
toString() String
A string representation of this object.
inherited
writeAudiogram(List<double> frequencies, List<double> leftEarSensitivities, List<double> rightEarSensitivities, DateTime startTime, DateTime endTime, {Map<String, dynamic>? metadata}) Future<bool>
Saves audiogram into Apple Health.
writeBloodOxygen(double saturation, DateTime startTime, DateTime endTime, {double flowRate = 0.0}) Future<bool>
Saves blood oxygen saturation record into Apple Health or Google Fit/Health Connect.
writeBloodPressure(int systolic, int diastolic, DateTime startTime, DateTime endTime) Future<bool>
Saves blood pressure record into Apple Health or Google Fit.
writeHealthData(double value, HealthDataType type, DateTime startTime, DateTime endTime, {HealthDataUnit? unit}) Future<bool>
Saves health data into Apple Health or Google Fit.
writeWorkoutData(HealthWorkoutActivityType activityType, DateTime start, DateTime end, {int? totalEnergyBurned, HealthDataUnit totalEnergyBurnedUnit = HealthDataUnit.KILOCALORIE, int? totalDistance, HealthDataUnit totalDistanceUnit = HealthDataUnit.METER}) Future<bool>
Write workout data to Apple Health

Operators

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

Static Methods

removeDuplicates(List<HealthDataPoint> points) List<HealthDataPoint>
Given an array of HealthDataPoints, this method will return the array without any duplicates.