WriteStream class abstract

The slice of an output stream a CLI needs: write text, know whether it is attached to a terminal, and move the cursor for in-place updates.

Mirrors Node's Pick<NodeJS.WriteStream, "write" | "isTTY" | "clearLine" | "cursorTo">. Named WriteStream rather than Stream so it does not shadow dart:async's Stream in every consumer.

Implement this to capture output in tests; see StdioWriteStream for the process-stream implementation.

Implementers

Constructors

WriteStream()

Properties

hashCode int
The hash code for this object.
no setterinherited
isTTY bool
Whether the stream is attached to an interactive terminal. Spinners and ANSI colour are suppressed when this is false.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearLine(int dir) → void
Clears part of the current line: to its start when dir is negative, to its end when positive, and the whole line at zero.
cursorTo(int column) → void
Moves the cursor to column, counted from zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(String chunk) → void
Writes chunk verbatim. No newline is appended.

Operators

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