write method

  1. @override
void write(
  1. String data
)
override

Writes raw data to the terminal.

Implementation

@override
void write(String data) {
  for (final char in data.split('')) {
    if (char == '\n') {
      _cursorX = 0;
      _cursorY++;
      if (_cursorY >= _height) break;
    } else if (_cursorX < _width && _cursorY < _height) {
      _grid[_cursorY][_cursorX] = char;
      _cursorX++;
    }
  }
}