WizardNav class

Navigation-aware prompt wrappers used by the interactive wizard.

Each method is a thin layer over UserPrompt that recognizes "go back" triggers and converts them into a BackNavigation exception, allowing the calling wizard to rewind one step.

All methods preserve the underlying prompt UX — the only behavioural change is the new keywords / appended menu options.

Constructors

WizardNav()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

askString(String question, {String? defaultValue, bool validator(String)?, String? validationMessage, String? fromStep}) Future<String>
Drop-in replacement for UserPrompt.askString that throws BackNavigation when the user types one of backKeywords and CancelNavigation when the user types one of cancelKeywords.
askTheme(String prompt, List<String> themes, List<String> descriptions, {int initialIndex = 0, String? fromStep}) Future<int>
Theme/option selector with an appended "Back" item that throws BackNavigation when chosen.
askYesNo(String question, {bool defaultValue = true, String? fromStep}) Future<bool>
Yes/No prompt with an extra "Back" option. Throws BackNavigation when the user picks the third option.
printNavHint() → void
Print a one-line hint at the top of every wizard step so the user always knows how to retreat. Idempotent — call this freely.
showMenu(String title, List<String> options, {int? defaultIndex, String? fromStep}) Future<int>
Plain menu with a Back option appended.

Constants

backKeywords → const Set<String>
Magic keywords that move the wizard backwards when typed into a text input. The < prefix is intentional: it's the single-keystroke shortcut some users prefer over typing the full word.
backOptionLabel → const String
Visible menu suffix appended to selectable prompts to advertise back-navigation. Kept in one place so we can change the glyph in one edit.
cancelKeywords → const Set<String>
Magic keywords that abort the wizard from any prompt.