previousStep method

void previousStep({
  1. required T tutorialId,
  2. String? route,
  3. Object? arguments,
  4. bool backToPreviousPage = false,
  5. BuildContext? context,
})

Returns to previous step (if not first step)

Optional navigation:

  • route: Name of route to push
  • arguments: Route arguments
  • backToPreviousPage: Pop current route
  • context: Required for navigation if no custom navigator provided

Implementation

void previousStep({
  required T tutorialId,
  String? route,
  Object? arguments,
  bool backToPreviousPage = false,
  BuildContext? context,
}) {
  _validateTutorialId(tutorialId);

  final current = getCurrentStep(tutorialId);
  if (current > 0) {
    _currentSteps[tutorialId] = current - 1;
    _handleNavigation(
      route: route,
      arguments: arguments,
      back: backToPreviousPage,
      context: context,
    );
    notifyListeners();
  }
}