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
- Future done
-
read-only, inherited
- Encoding encoding
-
read / write, inherited
- bool hasTerminal
-
read-onlyReturns true if there is a terminal attached to stdout.
- IOSink nonBlocking
-
read-onlyGet a non-blocking
IOSink
. - int terminalColumns
-
read-onlyGet the number of columns of the terminal.
- int terminalLines
-
read-onlyGet the number of lines of the terminal.
Methods
-
add(
List<int> data) → void -
inheritedAdds
data
to the target consumer, ignoringencoding
. -
addError(
error, [StackTrace stackTrace]) → void -
inheritedPasses the error to the target consumer as an error event.
-
addStream(
Stream<List<int>> stream) → Future -
inheritedAdds all elements of the given
stream
tothis
. -
close(
) → Future -
inheritedClose the target consumer.
-
flush(
) → Future -
inheritedReturns a
Future
that completes once all buffered data is accepted by the to underlyingStreamConsumer
. -
write(
object) → void -
inheritedConverts
obj
to a String by invokingObject.toString
andadd
s the encoding of the result to the target consumer. -
writeAll(
objects, [sep = ""]) → void -
inheritedIterates over the given
objects
andwrite
s them in sequence. -
writeCharCode(
int charCode) → void -
inheritedWrites the
charCode
tothis
. -
writeln(
[object = ""]) → void -
inheritedConverts
obj
to a String by invokingObject.toString
and writes the result tothis
, followed by a newline.