Stdout class

Stdout represents the IOSink for either stdout or stderr.

Stdout represents the IOSink for either stdout or stderr.

It provides a blocking IOSink, so using this to write will block until the output is written.

In some situations this blocking behavior is undesirable as it does not provide the same non-blocking behavior as dart:io in general exposes. Use the property nonBlocking to get an IOSink which has the non-blocking behavior.

This class can also be used to check whether stdout or stderr is connected to a terminal and query some terminal properties.

Implements

Instance Properties

hasTerminal bool
read-only
terminalColumns int
read-only
terminalLines int
read-only
nonBlocking IOSink
read-only
encoding Encoding Inherited
read / write
done Future Inherited
read-only

Instance Methods

write(object) → void Inherited
Converts [obj] to a String by invoking [Object.toString] and [add]s the encoding of the result to the target consumer.
writeln([object = ""]) → void Inherited
Converts [obj] to a String by invoking [Object.toString] and writes the result to this, followed by a newline.
writeAll(objects, [sep = ""]) → void Inherited
Iterates over the given [objects] and [write]s them in sequence.
add(List<int> data) → void Inherited
Adds [data] to the target consumer, ignoring [encoding].
addError(error, [StackTrace stackTrace]) → void Inherited
Passes the error to the target consumer as an error event.
writeCharCode(int charCode) → void Inherited
Writes the [charCode] to this.
addStream(Stream<List<int>> stream) → Future Inherited
Adds all elements of the given [stream] to this.
flush() → Future Inherited
Returns a [Future] that completes once all buffered data is accepted by the to underlying [StreamConsumer].
close() → Future Inherited
Close the target consumer.