Skip to content

RPFormStep

A RPFormStep is a special type of RPQuestionStep, used for presenting multiple questions on a single scrollable page.

Questions in the form is represented by an list of questions and all questions needs to be answered (or be optional) in order to proceed from the form.

The result of an RPFormStep is an RPStepResult that consists further RPStepResults for each question in the form.

Inheritance
Annotations

Constructors

RPFormStep.fromJson

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

RPFormStep

RPFormStep({
  1. required String identifier,
  2. required String title,
  3. bool optional = false,
  4. bool autoSkip = false,
  5. Duration timeout = const Duration(seconds: 0),
  6. required List<RPQuestionStep> questions,
  7. bool saveResultsOnAutoSkip = false,
  8. bool forceWait = false,
  9. String? footnote,
})

Create a new RPFormStep holding a list of questions.

Properties

forceWait

bool forceWait
getter/setter pair

If forceWait is true, the RPTimerStep will only allow to move to next step after finishing the countdown. If 'false' the "next" will be possible respecting the mandatory/optional option defined above. This is false by default.

fromJsonFunction

Function get fromJsonFunction
override

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

questions

List<RPQuestionStep> questions
getter/setter pair

The list of questions to be shown on the form.

saveResultsOnAutoSkip

bool saveResultsOnAutoSkip
getter/setter pair

Should any preliminary results from this form be collected and saved, even if autoSkip is enabled?

If true, when timeout is over whatever answers has been provided to far will be submitted.

False 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.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.