LiveLineEditor class

Reads lines for the metro live shell, with editing, history and Tab completion.

When input isn't an interactive terminal, such as a script piped into metro live, lines are read as they are, without editing.

Constructors

LiveLineEditor({required Stream<List<int>> input, required StringSink output, LiveTerminal terminal = const StdioLiveTerminal(), List<String> history = const [], int historyLimit = 500, LiveCompleter? complete})
Creates a LiveLineEditor that reads bytes from input and writes to output.

Properties

hashCode → int
The hash code for this object.
no setterinherited
history → List<String>
Submitted lines, oldest first.
no setter
isReading → bool
Whether a readLine call is waiting for a line.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelLine() → void
Discards the line being typed and shows a fresh prompt.
close() → Future<void>
Puts the terminal back the way it was and stops reading input.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printAbove(String text) → void
Prints text above the prompt, keeping what's been typed so far.
readLine(String prompt) → Future<String?>
Prints prompt and reads one line.
toString() → String
A string representation of this object.
inherited
updatePrompt(String prompt) → void
Replaces the prompt, redrawing the line being typed.

Operators

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