Runs a PromptView: shows it, feeds it keys and gives back its answer.
Picks how to ask from PromptMode.current:
- PromptMode.rich: a live prompt redrawn on every key press.
- PromptMode.line: the prompt's PromptView.fallback, typed answers.
- PromptMode.unattended: the prompt's PromptView.unattended answer.
In every mode the prompt ends with one ✔ question answer line. A
cancelled prompt throws PromptCancelled.
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
-
answeredLine(
String question, String answer) → String - The line left behind by an answered prompt: tick, question, answer.
-
cancelledLine(
String question, [String reason = 'cancelled']) → String -
The line left behind by a cancelled prompt, with an optional
reason. -
keysLine(
List< KeyHint> keys) → String -
The dim key hints line, like
↑↓ move enter pick esc cancel. -
run<
T> (PromptView< T> view) → T -
Asks
viewand gives back its answer. -
say(
String line, [Terminal? terminal]) → void -
Prints
lineonterminal(or Terminal.current), without styles if colour is off.