SurveyStep<T> constructor

SurveyStep<T>({
  1. required String id,
  2. required String title,
  3. String? description,
  4. required SurveyStepType stepType,
  5. List<SurveyOption>? options,
  6. T? answer,
  7. bool isRequired = true,
  8. Future<void> beforeComplete(
    1. dynamic answer
    )?,
  9. void onCompleted(
    1. dynamic answer
    )?,
  10. Future<void> onInit(
    1. SurveyStep<T>? step
    )?,
  11. Widget customWidget(
    1. BuildContext context,
    2. SurveyStep<T> step
    )?,
})

Implementation

SurveyStep({
  required this.id,
  required this.title,
  this.description,
  required this.stepType,
  this.options,
  this.answer,
  this.isRequired = true,
  this.beforeComplete,
  this.onCompleted,
  this.onInit,
  this.customWidget,
}) : assert(
        stepType != SurveyStepType.multipleChoiceSingleSelect ||
            (options != null && options.length >= 2),
        'Multiple choice questions must have at least two options.',
      );