nextStep method
Step?
nextStep({
- required Step step,
- required List<
StepResult> previousResults, - StepResult? questionResult,
override
Implementation
@override
Step? nextStep({
required Step step,
required List<StepResult> previousResults,
StepResult? questionResult,
}) {
record(step);
final navigableTask = task as NavigableTask;
final rule = navigableTask.getRuleByStepIdentifier(step.id);
if (rule == null) {
return nextInList(step);
}
switch (rule.runtimeType) {
case DirectNavigationRule:
return task.steps.firstWhere(
(element) =>
element.id ==
(rule as DirectNavigationRule).destinationStepIdentifier,
);
case ConditionalNavigationRule:
return evaluateNextStep(
step,
rule as ConditionalNavigationRule,
previousResults,
questionResult,
);
}
return nextInList(step);
}