evaluateNextStep method

Step? evaluateNextStep(
  1. Step? step,
  2. ConditionalNavigationRule rule,
  3. List<StepResult> previousResults,
  4. StepResult? questionResult,
)

Implementation

Step? evaluateNextStep(
  Step? step,
  ConditionalNavigationRule rule,
  List<StepResult> previousResults,
  StepResult? questionResult,
) {
  final nextStepIdentifier =
      rule.resultToStepIdentifierMapper(previousResults, questionResult);
  if (nextStepIdentifier == null) {
    return nextInList(step);
  }
  return task.steps.firstWhere((element) => element.id == nextStepIdentifier);
}