Skip to content

RPChoice

The choice object which the participant can choose during a RPQuestionStep with RPChoiceAnswerFormat.

Inheritance
Annotations

Constructors

RPChoice.fromJson

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

RPChoice

RPChoice({
  1. required String text,
  2. required int value,
  3. bool isFreeText = false,
  4. String? detailText,
})

Default constructor.

Properties

detailText

String? detailText
getter/setter pair

The detailed text to show if needed. Shown as a Info-icon which takes the user to a detail page with the detailText

fromJsonFunction

Function get fromJsonFunction
override

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

isFreeText

bool isFreeText
getter/setter pair

If set to true, then the user can enter the text instead of the default text which was provided. The value remains the same. By default it is set to false. text will be shown as a hintText

text

String text
getter/setter pair

The text to display.

value

int value
getter/setter pair

The value of this choice - for example 4 on a 0-5 scale.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.