TaskConfiguration class

A named group of Measures that a device runs when a trigger fires.

A task is added to a protocol together with a TriggerConfiguration via StudyProtocol.addTaskControl, which creates a TaskControl. When the trigger fires, the client starts (or stops) all of the task's measures.

Key points:

  • The name identifies the task and must be unique within a protocol. If not given, a name like 'Task #3' is generated.
  • Duplicate measures (same type) are removed when the task is created.
  • Subclasses define how the task runs, e.g. BackgroundTask. CARP Mobile Sensing adds AppTask for tasks the user does in the app.
Inheritance
  • Object
  • Serializable
  • TaskConfiguration
Implementers
Annotations
  • @JsonSerializable.new(includeIfNull: false, explicitToJson: true)

Constructors

TaskConfiguration({String? name, String? description, List<Measure>? measures})
Create a task. The name uniquely identifies the task. If name is not specified, a name is generated.
TaskConfiguration.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
description ↔ String?
A description of this task, emphasizing the reason why the data is collected.
getter/setter pair
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 setterinherited
jsonType → String
The __type used for JSON serialization of this class.
no setteroverride
measures ↔ List<Measure>?
The data which needs to be collected/measured passively as part of this task.
getter/setter pair
name ↔ String
A name which uniquely identifies the task.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMeasure(Measure measure) → void
Add measure to this task.
addMeasures(Iterable<Measure> list) → void
Add a list of measures to this task.
getAllExpectedDataTypes() → Set<String>
Get data types of all data which may be collected, either passively as part of task measures, or as the result of user interactions, for this task.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMeasure(Measure measure) → void
Remove measure from this task.
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.
inherited