Skip to content

WebTask

Redirects to a web page which contains the task which needs to be performed. The passive measures are started when the website is opened and stopped when it is closed.

Inheritance
Annotations

Constructors

WebTask.fromJson

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

WebTask

WebTask({
  1. String? name,
  2. String? description,
  3. List<Measure>? measures,
  4. required String url,
})

Create a task which redirects to a web page url.

Properties

fromJsonFunction

Function get fromJsonFunction
override

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

url

String url
getter/setter pair

The URL of the web page which contains the task to be performed.

The URL may contain the following patterns, which will be replaced with the corresponding values by the client runtime:

  • $PARTICIPANT_ID - Uniquely identifies the participant in the study.
  • $DEPLOYMENT_ID - Uniquely identifies the deployment (group of participants and devices) of the study.
  • $TRIGGER_ID - Identifies the condition, defined by the study protocol, which caused the WebTask to be triggered.

Methods

getUrl

String getUrl(
  1. String participantId,
  2. String studyDeploymentId,
  3. int triggerId
)

Returns url with $PARTICIPANT_ID, $DEPLOYMENT_ID and $TRIGGER_ID replaced by participantId, studyDeploymentId and triggerId.

Only the first occurrence of each variable is replaced.

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.