SurveyStep<T>.yesNo constructor
SurveyStep<T>.yesNo ({
- required String id,
- required String title,
- String? description,
- List<
SurveyOption> ? options, - T? answer,
- bool isRequired = true,
- Future<
void> beforeComplete(- dynamic answer
- void onCompleted(
- dynamic answer
- Future<
void> onInit(- SurveyStep<
T> ? step
- SurveyStep<
- Widget customWidget(
- BuildContext context,
- SurveyStep<
T> step
Constructor for creating a yes/no survey step.
Parameters:
- id: The unique identifier for the step.
- title: The display title for the step.
- description: An optional description for the step.
- options: A list of SurveyOption objects representing the choices.
- isRequired: A boolean indicating if the step is required.
Implementation
SurveyStep.yesNo({
required this.id,
required this.title,
this.description,
List<SurveyOption>? options,
this.answer,
this.isRequired = true,
this.beforeComplete,
this.onCompleted,
this.onInit,
this.customWidget,
}) : options = options ??
[
SurveyOption(id: 'yes', title: 'Yes'),
SurveyOption(id: 'no', title: 'No')
],
stepType = SurveyStepType.yesNo,
assert(options == null || options.length == 2,
'Yes/No questions must have exactly two options.');