nextStep method

void nextStep(
  1. T tutorialId, {
  2. String? route,
  3. bool backToPreviousPage = false,
  4. BuildContext? context,
})

Advances to the next step in the tutorial. If route is provided, navigates to that route. If backToPreviousPage is true, pops the current page.

Implementation

void nextStep(
  T tutorialId, {
  String? route,
  bool backToPreviousPage = false,
  BuildContext? context,
}) {
  if (!_tutorials.containsKey(tutorialId)) {
    throw Exception('Tutorial ID "$tutorialId" not found');
  }
  _state.nextStep(tutorialId);
  if (route != null && context != null) {
    Navigator.pushNamed(context, route);
  } else if (backToPreviousPage && context != null) {
    Navigator.pop(context);
  }
}