next<T extends Object?> method

Future<T?> next<T extends Object?>({
  1. Object? arguments,
})

Requests the wizard to show the next page. Optionally, arguments can be passed to the next page.

Implementation

Future<T?> next<T extends Object?>({Object? arguments}) async {
  final next = await _loadRoute<T>(currentRoute, (name) {
    return _getNextRoute<T>(name, arguments, routes[name]!.onNext);
  });

  _updateState((state) {
    final copy = List<WizardRouteSettings>.of(state);
    return copy..add(next);
  });

  return next.completer.future;
}