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
Properties
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