Skip to content

FunctionTask

A task that can run a custom Dart function.

The function runs each time the task is resumed, see FunctionTaskExecutor. The function cannot be serialized to/from JSON, so it is lost when the protocol is stored or retrieved from a DeploymentService. Use this task only in a StudyProtocol built in Dart code in the app.

Inheritance
Annotations

Constructors

FunctionTask.fromJson

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

FunctionTask

FunctionTask({
  1. String? name,
  2. String? description,
  3. VoidFunction? function,
})

Creates a function task that executes function when resumed.

Properties

fromJsonFunction

Function get fromJsonFunction
override

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

function

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

The function to execute when this task is resumed.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.