backStep method

void backStep(
  1. FormStep? currentStep
)

Implementation

void backStep(FormStep? currentStep) {
  FormStep? nextStep;
  if (relevantStack.containsKey(currentStep?.id?.id)) {
    nextStep = relevantStack[currentStep?.id?.id];
  } else {
    nextStep = currentStep?.previousStep ?? currentStep?.previous;
    if (nextStep != null) {
      onUpdate?.call(nextStep);
    } else if (previousFormStackForm != null) {
      onRenderFormSatackForm?.call(previousFormStackForm!);
      return;
    }
  }
  if (nextStep != null) {
    onUpdate?.call(nextStep);
  } else {
    onFinish?.call(result);
  }
}