Skip to content

RPTaskResult

The result object a Task creates

Inheritance
Annotations

Constructors

RPTaskResult.fromJson

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

RPTaskResult

RPTaskResult({
  1. required String identifier,
})

Create a RPTaskResult with a given identifier and an empty map of results.

identifier should always be the identifier of the "parent" task. It sets startDate to the DateTime.now(). Since these objects are instantiated together with the Task it belongs to so it can be used for measuring how much time the participant spent on the given Task.

Properties

fromJsonFunction

Function get fromJsonFunction
override

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

results

Map<String, RPResult> results
getter/setter pair

The results of each step of this task result.

Each entry represents a step's result (RPResult). The keys are strings with the identifiers of the corresponding step.

Methods

getStepResultForIdentifier

RPResult? getStepResultForIdentifier(
  1. String identifier
)

Returns result value for the given identifier.

setStepResultForIdentifier

void setStepResultForIdentifier(
  1. String identifier,
  2. RPResult result
)

Add a result to the results map with the given identifier.

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.