RenderOutput class

A line-tracking output buffer that only clears what it wrote.

Instead of clearing the entire terminal, this tracks how many lines were written and uses cursor movement to clear just those lines before re-rendering. This preserves any terminal content that existed before the prompt/view started.

Standalone usage (for simple display views):

final out = RenderOutput();
out.writeln('Line 1');
out.writeln('Line 2');
// Content stays visible, terminal history preserved

With updates (for updating displays):

final out = RenderOutput();
out.writeln('Step 1');
// ... do work ...
out.clear();
out.writeln('Step 2');

Constructors

RenderOutput()

Properties

hashCode int
The hash code for this object.
no setterinherited
lineCount int
Number of lines written since the last clear.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears only the lines we wrote by moving cursor up and erasing. This preserves terminal content from before the prompt/view started. Call this before re-rendering to update the display.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(String text) → void
Writes text without a trailing newline (newlines in text are counted).
writeln([String line = '']) → void
Writes a line to the terminal output and tracks it.

Operators

operator ==(Object other) bool
The equality operator.
inherited