PromptDriver class abstract
Contract for interactive user-prompt I/O in the PluginInstaller DSL.
Mirrors the four-method surface of the static Prompt class so that
InstallContext can hold an instance field and tests can inject a
FakePromptDriver without touching stdin.
Usage
final driver = RealPromptDriver();
final name = driver.ask('Plugin name?', defaultValue: 'my_plugin');
if (driver.confirm('Publish stubs?')) { ... }
- Implementers
Constructors
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
-
ask(
String question, {String? defaultValue, String? validator(String)?}) → String - Ask a free-form question and return the user's trimmed answer.
-
choice(
String question, {required List< String> options, String? defaultValue}) → String - Ask the user to pick one option from a closed list.
-
confirm(
String question, {bool defaultValue = false}) → bool - Ask a yes/no question and return the boolean result.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
secret(
String question) → String - Ask a question while hiding typed characters (passwords, tokens).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited