Skip to content

RPInstructionStep

A step which can be used to show instructions and other information to the participant. Usually it is used as the first step in a Task explaining the task.

Inheritance
Annotations

Constructors

RPInstructionStep.fromJson

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

RPInstructionStep

RPInstructionStep({
  1. required String identifier,
  2. required String title,
  3. String? text,
  4. bool optional = false,
  5. String? detailText,
  6. String? imagePath,
  7. String? audioPath,
  8. String? videoPath,
  9. String? footnote,
  10. String? nextButtonText,
})

Properties

audioPath

String? audioPath
getter/setter pair

The path of the audio to play after the Instruction Step is finished.

Remember to add audio to use as an asset to your pubspec.yaml file.

If null the ui is not shown.

detailText

String? detailText
getter/setter pair

The text which is shown in a new window by pressing the "Learn more" button. If null, no "Learn more" button is shown.

fromJsonFunction

Function get fromJsonFunction
override

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

imagePath

String? imagePath
getter/setter pair

The path of the image to show during the Instruction Step (e.g.: "assets/picture.png").

Remember to add images to use as an asset to your pubspec.yaml file.

If null nothing is shown.

stepWidget

Widget get stepWidget
override

The widget (UI representation) of the step.

RPQuestionSteps don't have it because their UI representation depends on the Answer Format. Their Answer Format is assessed by RPUIQuestionStep or RPUIFormStep and they return the corresponding UI.

When needed, it should be overridden to fit the different types of Steps.

videoPath

String? videoPath
getter/setter pair

Methods

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.