PromptRunner class abstract final cli

Runs a PromptView: shows it, feeds it keys and gives back its answer.

Picks how to ask from PromptMode.current:

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 view and gives back its answer.
say(String line, [Terminal? terminal]) → void
Prints line on terminal (or Terminal.current), without styles if colour is off.