clear method

  1. @override
void clear()
override

Resets all cells in the buffer to transparent empty cells.

Implementation

@override
void clear() {
  for (var y = 0; y < bounds.height; y++) {
    for (var x = 0; x < bounds.width; x++) {
      final cell = parent.getCell(bounds.x + x, bounds.y + y);
      if (cell != null) {
        if (cell.char != ' ' || cell.style != Style.transparent) {
          cell.char = ' ';
          cell.style = Style.transparent;
        }
      }
    }
  }
}