nextStep method

Future<bool> nextStep({
  1. bool force = false,
})

Navigate to the next step - returns true if successful For use when explicitly wanting to navigate, typically from a button press Set force to true to bypass validation and directly navigate

Implementation

Future<bool> nextStep({bool force = false}) async {
  if (force) {
    return await _actions.nextPage();
  }

  // Validation logic
  if (!await canContinue()) {
    return false;
  }

  await onBeforeNext();

  if (isLastStep) {
    await onComplete();
    return true;
  }

  bool success = await _actions.nextPage();
  if (success) {
    await onAfterNext();
  }

  return success;
}