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
-
- Object
- Serializable
- TaskConfiguration
- FunctionTask
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
FunctionTask.fromJson
FunctionTask
- String? name,
- String? description,
- VoidFunction? function,
Creates a function task that executes function when resumed.
Properties
fromJsonFunction
The function which can convert a JSON string to an object of this type.
function
- @JsonKey(includeFromJson: false, includeToJson: false)
getter/setter pair
The function to execute when this task is resumed.
Methods
toJson
Return a JSON encoding of this object.