Printer class final

A printer that processes ANSI escape codes and replaces the default text style.

This printer buffers strings line by line and outputs them using the provided output function, or Zone.current.print by default. It uses Parser to track the current Style across multiple prints.

See also runZonedPrinter for usage within a zone.

Implemented types

Constructors

Printer({Style defaultStyle = Style.defaults, void output(String line)?, bool ansiCodesEnabled = true, @visibleForTesting bool? debugForTest})
Creates a printer that processes ANSI escape codes and replaces the default text style.

Properties

ansiCodesEnabled bool
finalinherited
debugForTest bool
getter/setter pairinherited
defaultStyle Style
finalinherited
hashCode int
The hash code for this object.
no setterinherited
lastState Style?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateDefaults Style
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(String line) String
Prepares the given line for printing.
inherited
print(Object? object) → void
Prints the given object to the output.
inherited
toString() String
A string representation of this object.
inherited
write(Object? object) → void
Writes the given object to the buffer.
inherited
writeAll(Iterable<Object?> objects, [String separator = '']) → void
Writes the given objects to the buffer.
inherited
writeCharCode(int charCode) → void
Writes the given character code to the buffer.
inherited
writeln([Object? object = '']) → void
Writes the given object to the buffer and flush buffer.
inherited

Operators

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