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