clearLine method
Clears the current console line without moving the cursor. If you want to write over the current line then call clearLine followed by startOfLine and then use write rather than print as it will leave the cursor on the current line. Alternatively use overwriteLine;
Implementation
void clearLine({TerminalClearMode mode = TerminalClearMode.all}) {
switch (mode) {
// case AnsiClearMode.scrollback:
case TerminalClearMode.all:
_console.eraseLine();
break;
case TerminalClearMode.fromCursor:
_console.eraseCursorToEnd();
break;
case TerminalClearMode.toCursor:
write('${Ansi.esc}1K');
break;
}
}