Skip to content

RPOrderedTask

A simple linear task which implement the RPTask protocol. It shows the steps one after another without the option of going back or branching.

For simple tasks the RPOrderedTask is perfect. For more features (going back to previous questions, branching...) consider using RPNavigableOrderedTask which inherited from this class.

Inheritance
Implementers
Annotations

Constructors

RPOrderedTask.fromJson

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

RPOrderedTask

RPOrderedTask({
  1. required String identifier,
  2. bool closeAfterFinished = true,
  3. required List<RPStep> steps,
})

Properties

fromJsonFunction

Function get fromJsonFunction
override

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

isConsentTask

bool get isConsentTask

Returns true if the task is a Consent Task. It is considered a Consent Task if it has an RPConsentReviewStep

numberOfQuestionSteps

int get numberOfQuestionSteps

The number of question steps in the task

steps

List<RPStep> steps
getter/setter pair

The list of RPSteps of the task

Methods

getStepAfterStep

RPStep? getStepAfterStep(
  1. RPStep? step,
  2. RPTaskResult? result
)
override

Returns the step after a specified step if there's any. If the specified step is null then it returns the first step.

Returns null if step was the last one in the sequence.

getStepBeforeStep

RPStep? getStepBeforeStep(
  1. RPStep? step,
  2. RPTaskResult? result
)
override

Returns the step that precedes the specified step, if there is one. If the specified step is null then it returns the last step.

Returns null if step was the first one in the sequence.

getStepWithIdentifier

RPStep? getStepWithIdentifier(
  1. String identifier
)
override

Returns the step that matches the specified identifier. Returns null if there is no step with the identifier.

getTitleForStep

String getTitleForStep(
  1. RPStep step
)
override

Returns the title of a given step

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.