Measure class

Defines one type of data to collect passively as part of a task.

A measure names a data type (e.g., dk.cachet.carp.geolocation) and is added to a TaskConfiguration. When the task is triggered, the client collects this data type, typically through a probe.

Key points:

var task = BackgroundTask(measures: [
  Measure(type: CarpDataTypes.STEP_COUNT),
  Measure(type: CarpDataTypes.GEOLOCATION),
]);
Inheritance
Annotations
  • @JsonSerializable.new(includeIfNull: false, explicitToJson: true)

Constructors

Measure({required String type, SamplingConfiguration? samplingConfiguration})
Create a measure by specifying its type and optionally a samplingConfiguration to override the default sampling configuration.
Measure.fromJson(Map<String, dynamic> json)
factory

Properties

$type ↔ String?
The type name written to __type in JSON; set to jsonType on creation.
getter/setter pairinherited
dataType → DataType
The type of measure as a DataType.
no setter
fromJsonFunction → Function
The generated function that converts a JSON map to an object of this type.
no setteroverride
hashCode → int
The hash code for this object.
no setteroverride
jsonType → String
The __type used for JSON serialization of this class.
no setteroverride
overrideSamplingConfiguration ↔ SamplingConfiguration?
Optionally, override the default configuration on how to sample the data stream of the matching type on the device. In case null is specified, the default configuration is derived from the DeviceConfiguration.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type ↔ String
The type of measure to do.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Returns a JSON map of this object, including the __type property.
override
toString() → String
A string representation of this object.
override

Operators

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