canonical / canonical/ubuntu-flutter-plugins
Allow `Wizard.of(context).next()` for the last route as well?
- Dominant language
- Dart
- Stars
- 66
- Forks
- 16
- Avg merge
- 19m
- Merged PRs (30d)
- 1
Description
I have the following wizard setup, which looks quite natural to me and doesn't require the `ConfirmAuthPage` to do anything with `GoRouter` (thus, it can be safely moved around without any fear of breaking the flow):
```dart
@override
Widget build(BuildContext context) {
return Wizard(
routes: {
'/request':
WizardRoute(builder: (_) => const RequestAuthPage()),
'/confirm': WizardRoute(
builder: (_) => const ConfirmAuthPage(),
onNext: (_) {
GoRouter.of(context).pop();
return null;
},
),
},
);
}
```
The problem is that Wizard doesn't let me call `next()` from within the `ConfirmAuthPage`, which seems to leave me no choice other than introducing `GoRouter` routing right into the `ConfirmAuthPage`, which I'd want to avoid.
What do you think about adding an option to allow `next()` on the last page of the flow or even allowing it unconditionally (doing nothing if there's no next page in the flow)?
Contributor guide
Research direction
Start by reading the Wizard and WizardRoute implementations, especially how next() handles the final route and how onNext is invoked. Confirm the desired behavior from the example: calling next() on ConfirmAuthPage should be permitted and should invoke the configured final-route action or otherwise do nothing when no next route exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100