MarkedMeasure class

A MarkedMeasure specify how to collect data historically back to a persistent mark.

This measure persistently marks the last time this data measure was done and provide this in the lastTime variable. This is useful for measures that want to collect data since last time it was collected. For example the AppUsageMeasure.

A MarkedMeasure can only be used with DatumProbe, StreamProbe and PeriodicStreamProbe probes. The mark is read when the probe is resumed and saved when the probe is paused.



MarkedMeasure({@required String type, String name, String description, bool enabled, Duration history = const Duration(days: 1)})
MarkedMeasure.fromJson(Map<String, dynamic> json)


$type String
The runtime class name (type) of this object. Used for deserialization from JSON objects.
read / write, inherited
configuration Map<String, String>
A key-value map holding any application-specific configuration.
read / write, inherited
dataType DataType
The type of measure to do as a DataType.
@JsonKey(ignore: true), read-only, inherited
description String
A longer description of this measure.
read / write, inherited
enabled bool
Whether the measure is enabled - i.e. collecting data - when the study is running. A measure is enabled as default.
read / write, inherited
fromJsonFunction Function
The function which can convert a JSON string to an object of this type.
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
history Duration
If there is no persistent mark, how long time back in history should this measure be collected?
read / write
jsonType String
Return the $type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.
read-only, inherited
lastTime DateTime
The date and time of the last time this measure was collected.
@JsonKey(ignore: true), read / write
name String
A printer-friendly name for this measure.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
studyDeploymentId String
The study deployment id that this measure is part of. Set on runtime.
@JsonKey(ignore: true), read / write, inherited
type String
The type of measure to do.
read / write, inherited


adapt(Measure measure) → void
Adapt this Measure to a new value specified in measure.
addMeasureListener(MeasureListener listener) → void
Add a MeasureListener to this Measure.
getConfiguration(String key) String
Get value from the configuration for this measure.
hasChanged() Future
Call this method when this measure has changed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
removeMeasureListener(MeasureListener listener) → void
Remove a MeasureListener to this Measure.
restore() → void
Restore this Measure to its original value before adapt was called. [...]
setConfiguration(String key, String configuration) → void
Add a key-value pair as configuration for this measure.
tag() String
The tag to be used to uniquely identify this measure. Default is the type but can be overwritten in sub-classes.
toJson() Map<String, dynamic>
Return a JSON encoding of this object.
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]