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

Properties

done Future
read-only, inherited

encoding Encoding
read / write, inherited

hasTerminal bool
read-only

Returns true if there is a terminal attached to stdout.

nonBlocking IOSink
read-only

Get a non-blocking IOSink.

terminalColumns int
read-only

Get the number of columns of the terminal.

terminalLines int
read-only

Get the number of lines of the terminal.

Methods

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.

addStream(Stream<List<int>> stream) → Future
inherited

Adds all elements of the given stream to this.

close() → Future
inherited

Close the target consumer.

flush() → Future
inherited

Returns a Future that completes once all buffered data is accepted by the to underlying StreamConsumer.

write(object) → void
inherited

Converts obj to a String by invoking Object.toString and adds the encoding of the result to the target consumer.

writeAll(objects, [sep = ""]) → void
inherited

Iterates over the given objects and writes them in sequence.

writeCharCode(int charCode) → void
inherited

Writes the charCode to this.

writeln([object = ""]) → void
inherited

Converts obj to a String by invoking Object.toString and writes the result to this, followed by a newline.