previousStep method

void previousStep()

Returns to the previous step.

Decrements the current step index by 1. Does not validate if the previous step exists - callers should check bounds.

Example:

if (controller.value.currentStep > 0) {
  controller.previousStep();
}

Implementation

void previousStep() {
  value = StepperValue(
    stepStates: value.stepStates,
    currentStep: value.currentStep - 1,
  );
}