setStatus method
Sets or clears the state of a specific step.
Parameters:
step
(int): zero-based step index to modifystate
(StepState?): new state, or null to clear
Example:
// Mark step as failed
controller.setStatus(2, StepState.failed);
// Clear step state
controller.setStatus(2, null);
Implementation
void setStatus(int step, StepState? state) {
Map<int, StepState> newStates = Map.from(value.stepStates);
if (state == null) {
newStates.remove(step);
} else {
newStates[step] = state;
}
value = StepperValue(
stepStates: newStates,
currentStep: value.currentStep,
);
}