AnsiWriter class abstract

An output string sink that assumes the effect of ANSI escape codes.

What this means in practice is that it acts a translation layer from Dart APIs (i.e. setForegroundColor1) and adds equivalent ANSI escape sequence codes to the output buffer.

Implemented types

Constructors

AnsiWriter()
const
AnsiWriter.from(StringSink sink)
Creates an AnsiWriter that wraps and writes to the provided sink.
const
factory

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

clearBold() → void
Clears text decoration style to exclude bold.
override
clearLine() → void
Clears the current cline.
override
clearLineAfter() → void
Clears the current line after the cursor location.
override
clearLineBefore() → void
Clears the current line before the cursor location.
override
clearScreen() → void
Clears the entire output screen.
override
clearScreenAfter() → void
Clears the entire output screen after the cursor location.
override
clearScreenBefore() → void
Clears the entire output screen before the cursor location.
override
clearUnderlined() → void
Clears text decoration style to exclude single/double .
override
hideCursor() → void
Hides the cursor.
override
moveCursorDown([int rows = 1]) → void
Moves the cursor down rows.
override
moveCursorLeft([int columns = 1]) → void
Moves the cursor left columns.
override
moveCursorNextLine([int lines = 1]) → void
Moves the cursor to the beginning of the next lines.
override
moveCursorPreviousLine([int lines = 1]) → void
Moves the cursor to the beginning of the previous lines.
override
moveCursorRight([int columns = 1]) → void
Moves the cursor right columns.
override
moveCursorUp([int rows = 1]) → void
Moves the cursor up rows.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetStyles() → void
Resets all styling to the default.
override
restoreCursor() → void
Restores the current cursor position from a previously saved position.
override
reverseColors() → void
Reverses the foreground and background colors.
override
saveCursor() → void
Saves the current cursor position.
override
setBackgroundColor1(Ansi1BitColor color, {bool bright = false}) → void
Sets subequent text's background as a 1-bit color.
override
setBackgroundColor24(Color color) → void
Sets subsequent text's background as a 24-bit color.
override
setBackgroundColor8(Ansi8BitColor color) → void
Sets subsequent text's background as a 8-bit color.
override
setBold() → void
Sets text decoration style to include bold.
override
setCursorX(int column) → void
Moves the cursor to column.
override
setCursorY(int row) → void
Moves the cursor to row.
override
setDoubleUnderlined() → void
Sets text decoration style to include double .
override
setForegroundColor1(Ansi1BitColor color, {bool bright = false}) → void
Sets subsequent text's foreground as a 1-bit color.
override
setForegroundColor24(Color color) → void
Sets subsequent text's foreground as a 24-bit color.
override
setForegroundColor8(Ansi8BitColor color) → void
Sets subsequent text's foreground as a 8-bit color.
override
setUnderlined() → void
Sets text decoration style to include .
override
showCursor() → void
Shows the cursor.
override
toString() String
A string representation of this object.
inherited
write(Object? object) → void
Writes the string representation of object.
inherited
writeAll(Iterable objects, [String separator = ""]) → void
Writes the elements of objects separated by separator.
inherited
writeCharCode(int charCode) → void
Writes a string containing the character with code point charCode.
inherited
writeln([Object? object = ""]) → void
Writes the string representation of object followed by a newline.
inherited

Operators

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