previousStep method

Future<void> previousStep()

Moves to the previous step in the survey or cancels the survey if it's the first step.

Implementation

Future<void> previousStep() async {
  if (currentStepIndex > 0) {
    currentStepIndex--;
    await _previousPage();
    notifyListeners();
  } else {
    cancelSurvey();
  }
}