Question constructor

Question({
  1. required String question,
  2. bool singleChoice = true,
  3. Map<String, List<Question>?>? answerChoices,
  4. bool isMandatory = false,
  5. String? errorText,
  6. Map<String, dynamic>? properties,
  7. List<String>? answers,
})

Implementation

Question(
    {required this.question,
    this.singleChoice = true,
    Map<String, List<Question>?>? answerChoices,
    this.isMandatory = false,
    this.errorText,
    this.properties,
    List<String>? answers})
    : answers = answers ?? [],
      answerChoices = answerChoices ?? {},
      assert(
          properties != null && answerChoices!.isEmpty || properties == null);