Sample<Harmonized> class abstract

Equivalent of Sample from HealthKitReporter https://github.com/kvs-coder/HealthKitReporter

Supports map representation.

Has a Sample.from constructor to create instances from JSON payload coming from iOS native code and a generic Harmonized object.

Has a factory method for creating a specific instance of types:

Depending on request, requires permissions provided from available types:

The method parsed is used for mapping values to save data in HealthKit

Mixed-in types
Implementers

Constructors

Sample(String uuid, String identifier, num startTimestamp, num endTimestamp, Device? device, SourceRevision sourceRevision, Harmonized harmonized)
const
Sample.from(Map<String, dynamic> json, Harmonized harmonized)
General constructor from JSON payload

Properties

device → Device?
final
endTimestamp → num
Seconds since 1970
final
harmonized → Harmonized
final
hashCode → int
The hash code for this object.
no setterinherited
identifier → String
final
map → Map<String, dynamic>
General map representation
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceRevision → SourceRevision
final
startTimestamp → num
Seconds since 1970, also for samples built in Dart (see SecondsSinceEpoch.secondsSinceEpoch)
final
uuid → String
The uuid of the sample stored in HealthKit. Send the sample back with it to delete it or to unrelate it.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parsed() → Map<String, dynamic>
For saving or deleting data, prepares appropriate map for HealthKitReporter.save and HealthKitReporter.delete. uuid is part of it: the native side deletes the stored sample with it
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

collect(List list) → List<Sample>
factory for a list of JSON strings, as the sample queries reply.
factory(Map<String, dynamic> json) → Sample
Factory method to create instances as a result of HealthKitReporter.sampleQuery and HealthKitReporter.anchoredObjectQuery. Throws an InvalidValueException for an identifier it doesn't know, so no sample is dropped silently.