updateMessage method

void updateMessage(
  1. String newMessage
)

Updates the message displayed next to the spinner.

Implementation

void updateMessage(String newMessage) {
  if (_isRunning) {
    // Clear current line and re-render with new message
    if (_startCoordinate != null) {
      _console.cursorPosition = _startCoordinate;
    }
    _console.eraseCursorToEnd();
    _console.write('${spinnerCharacters[_frameIndex]} $newMessage');
  }
}