write method
Writes text to the terminal without a trailing newline.
Implementation
@override
void write(String text) {
if (text.isEmpty) return;
if (_flushInFlight != null) {
_pending.write(text);
_pendingLen += text.length;
return;
}
try {
_out.write(text);
} on StateError catch (e) {
if (_isSinkBoundToStream(e)) {
_pending.write(text);
_pendingLen += text.length;
unawaited(flush());
return;
}
rethrow;
}
}