getStepAfterStep method
Returns the step after a specified step if there's any. If the specified
step is null
then it returns the first step.
Returns null
if step
was the last one in the sequence.
Implementation
@override
RPStep? getStepAfterStep(RPStep? step, RPTaskResult? result) {
step?.timer?.cancel();
if (step == null) return steps.first;
int nextIndex = steps.indexOf(step) + 1;
if (nextIndex < steps.length) return steps[nextIndex];
return null;
}