Question class

Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, explicitToJson: true)

Constructors

Question({required String question, bool singleChoice = true, Map<String, List<Question>?>? answerChoices, bool isMandatory = false, String? errorText, Map<String, dynamic>? properties, List<String>? answers})
Question.fromJson(Map<String, dynamic> json)
factory

Properties

answerChoices Map<String, List<Question>?>
Used to configure the list of possible answer choices and their corresponding list of Question objects that follow.
final
answers List<String>
The list of answers selected by the user.
latefinal
errorText String?
The default error text to be shown upon failing validation.
final
hashCode int
The hash code for this object.
no setterinherited
isMandatory bool
If set to true the validation of the form fails if the question is left empty or doesn't satisfy a condition.
final
properties Map<String, dynamic>?
Custom properties for every question/field.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
question String
The parameter that contains the data pertaining to a question.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
singleChoice bool
The parameter that indicates whether the question is a single choice or multiple choice question.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited