Skip to content

TriggerConfiguration

A condition on a device that starts or stops tasks when it applies.

The condition can be time-bound, based on data streams, initiated by a user of the platform, or a combination of these. A trigger is paired with a TaskConfiguration via StudyProtocol.addTaskControl, which creates a TaskControl.

Key points:

Inheritance
Implementers
Annotations

Constructors

TriggerConfiguration.fromJson

TriggerConfiguration.fromJson(
  1. Map<String, dynamic> json
)

TriggerConfiguration

TriggerConfiguration({
  1. String? sourceDeviceRoleName,
  2. bool? requiresPrimaryDevice,
})

Create a trigger.

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

jsonType

String get jsonType
override

Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.

requiresPrimaryDevice

  1. @JsonKey(includeFromJson: false, includeToJson: false)
bool? requiresPrimaryDevice
getter/setter pair

Determines whether the trigger needs to be evaluated on a primary device (PrimaryDeviceConfiguration). For example, this is the case when the trigger is time bound and needs to be evaluated by a task scheduler running on a primary device. Not serialized.

sourceDeviceRoleName

String? sourceDeviceRoleName
getter/setter pair

The device role name from which the trigger originates.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.