Stdout class - dart:io library (original) (raw)
An IOSink connected to either the standard out or error of the process.
Provides a blocking IOSink
, so using it 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 that 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.
The addError
API is inherited from StreamSink and calling it will result in an unhandled asynchronous error unless there is an error handler ondone
.
The lineTerminator
field is used by the write
, writeln
, writeAll
and writeCharCode
methods to translate "\n"
. By default, "\n"
is output literally.
Implemented types
Properties
A future that will complete when the consumer closes, or when an error occurs.
no setterinherited
The Encoding used when writing strings.
getter/setter pairinherited
The hash code for this object.
no setterinherited
Whether there is a terminal attached to stdout.
no setter
Line ending appended by writeln
, and replacing "\n"
in some methods.
getter/setter pairinherited
A non-blocking IOSink
for the same output.
no setter
A representation of the runtime type of the object.
no setterinherited
Whether connected to a terminal that supports ANSI escape sequences.
no setter
The number of columns of the terminal.
no setter
The number of lines of the terminal.
no setter
Methods
Adds byte data
to the target consumer, ignoring encoding.
inherited
addError(Object error, [StackTrace? stackTrace])→ void
Passes the error to the target consumer as an error event.
inherited
addStream(Stream<List<int>> stream)→ Future
Adds all elements of the given stream
.
inherited
Close the target consumer.
inherited
Returns a Future that completes once all buffered data is accepted by the underlying StreamConsumer.
inherited
noSuchMethod(Invocation invocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
A string representation of this object.
inherited
Converts object
to a String by invoking Object.toString andadds the encoding of the result to the target consumer.
inherited
writeAll(Iterable objects, [String sep = ""])→ void
Iterates over the given objects
and write
s them in sequence.
inherited
writeCharCode(int charCode)→ void
Writes the character of charCode
.
inherited
writeln([Object? object = ""])→ void
Converts object
to a String by invoking Object.toString and writes the result to this
, followed by a newline.
inherited
Operators
operator ==(Object other)→ bool
The equality operator.
inherited