Skip to content

RPTimerStep

A step where the user is forced to wait for timeout before being allowed to proceed to the next step.

Inheritance
Annotations

Constructors

RPTimerStep.fromJson

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

RPTimerStep

RPTimerStep({
  1. required String identifier,
  2. required String title,
  3. bool optional = false,
  4. required Duration timeout,
  5. bool playSound = false,
  6. bool autoSkip = false,
  7. bool showTime = true,
  8. String? footnote,
})

Creates a RPTimerStep with an identifier, title and timeout.

The RPTimerStep is a step in which the user waits for timeout before being allowed to proceed. If showTime is true, a count down is shown.

When the time is up, a sound is played if playSound is true and automatically moves to the next step, if autoSkip is true.

Properties

autoSkip

bool autoSkip
getter/setter pair

Automatically move to the next step once finished counting down? False by default.

fromJsonFunction

Function get fromJsonFunction
override

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

playSound

bool playSound
getter/setter pair

Play a sound when the timer has finished counting down? False by default.

showTime

bool showTime
getter/setter pair

Should the remaining time be shown while counting down? If false only the title will be shown. True by default.

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.

timeout

Duration timeout
getter/setter pair

The time the user must wait before being able to continue.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.