PeriodicMeasure class Null safety

A PeriodicMeasure specify how to collect data on a regular basis.

Data collection will be started as specified by the frequency for a time interval specified as the duration. Useful for listening in on a sensor (e.g. the accelerometer) on a regular, but limited time window.



PeriodicMeasure({required String type, String? name, String? description, bool enabled = true, required Duration frequency, Duration duration = const Duration(seconds: 2)})
Create a PeriodicMeasure.
PeriodicMeasure.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
duration Duration
The sampling duration.
read / write
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
frequency Duration
Sampling frequency (i.e., delay between sampling).
read / write
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
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
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.
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. [...]