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