nextStep method
void
nextStep({
- required T tutorialId,
- String? route,
- Object? arguments,
- bool backToPreviousPage = false,
- BuildContext? context,
Advances to the next step or ends tutorial if last step.
Optional navigation:
route
: Name of route to pusharguments
: Route argumentsbackToPreviousPage
: Pop current routecontext
: Required for navigation if no custom navigator provided
Implementation
void nextStep({
required T tutorialId,
String? route,
Object? arguments,
bool backToPreviousPage = false,
BuildContext? context,
}) {
_validateTutorialId(tutorialId);
if (isLastStep(tutorialId)) {
endTutorial(tutorialId);
} else {
_currentSteps[tutorialId] = getCurrentStep(tutorialId) + 1;
}
_handleNavigation(
route: route,
arguments: arguments,
back: backToPreviousPage,
context: context,
);
notifyListeners();
}