Stdout class
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
- hasTerminal → bool read-only
-
Returns true if there is a terminal attached to stdout.
- nonBlocking → IOSink read-only
-
Get a non-blocking
IOSink
. - supportsAnsiEscapes → bool read-only
-
Whether connected to a terminal that supports ANSI escape sequences.
- terminalColumns → int read-only
-
Get the number of columns of the terminal.
- terminalLines → int read-only
- done → Future read-only, inherited
- encoding → Encoding read / write, inherited
- hashCode → int read-only, inherited
-
The hash code for this object.
- runtimeType → Type read-only, inherited
-
A representation of the runtime type of the object.
Operators
- operator ==(
other) → bool inherited -
The equality operator.
Methods
- add(
List<int> data) → void inherited -
Adds byte
data
to the target consumer, ignoringencoding
. - 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
tothis
. - close(
) → Future inherited -
Close the target consumer.
- flush(
) → Future inherited -
Returns a
Future
that completes once all buffered data is accepted by the underlyingStreamConsumer
. - noSuchMethod(
Invocation invocation) → dynamic inherited -
Invoked when a non-existent method or property is accessed.
- toString(
) → String inherited -
Returns a string representation of this object.
- write(
object) → void inherited -
Converts
obj
to a String by invokingObject.toString
andadd
s the encoding of the result to the target consumer. - writeAll(
objects, [ sep = "" ]) → void inherited -
Iterates over the given
objects
andwrite
s them in sequence. - writeCharCode(
int charCode) → void inherited -
Writes the character of
charCode
. - writeln(
[object = "" ]) → void inherited -
Converts
obj
to a String by invokingObject.toString
and writes the result tothis
, followed by a newline.
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/Stdout-class.html