Distance class

Equivalent of Distance from HealthConnectReporter https://github.com/kvs-coder/HealthConnectReporter

Distance moved, in m.

Supports map representation.

Has a Distance.fromJson constructor to create instances from JSON payload coming from Android native code. And supports multiple object creation by collect method from JSON list.

Requires HealthType.distance permissions provided.

Inheritance

Constructors

Distance({required int startTimestamp, required int endTimestamp, required DistanceHarmonized harmonized, String? id, String? clientRecordId, int? clientRecordVersion, int? startZoneOffsetSeconds, int? endZoneOffsetSeconds, RecordingMethod? recordingMethod, Device? device, DataOrigin? dataOrigin, int? lastModifiedTimestamp})
const
Distance.fromJson(Map<String, dynamic> json)
General constructor from JSON payload

Properties

clientRecordId → String?
Your own id for the record, kept by Health Connect; inserting it again updates the record
finalinherited
clientRecordVersion → int?
Your own version of clientRecordId; Health Connect keeps the highest
finalinherited
dataOrigin → DataOrigin?
The app that wrote the record; set by Health Connect
finalinherited
device → Device?
The device that recorded the data
finalinherited
endTimestamp → int
End time, epoch milliseconds, not before startTimestamp
final
endZoneOffsetSeconds → int?
Zone offset at endTimestamp in seconds; null means unknown
finalinherited
harmonized → DistanceHarmonized
The measured values; null for records without values
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
healthType → HealthType
The data type of this sample
no setteroverride
id → String?
Health Connect id of the stored record; null until it is inserted
finalinherited
lastModifiedTimestamp → int?
Last modification time, epoch milliseconds; set by Health Connect
finalinherited
map → Map<String, dynamic>
General map representation, with the type discriminator
no setterinherited
recordingMethod → RecordingMethod?
How the record was recorded; RecordingMethod.manualEntry when written as null
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startTimestamp → int
Start time (the measurement time of an instantaneous record), epoch milliseconds
finalinherited
startZoneOffsetSeconds → int?
Zone offset at startTimestamp in seconds; null means unknown
finalinherited

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

collect(List list) → List<Distance>
Simplifies creating a list of objects from JSON payload.
override