CanvasBuffer constructor

CanvasBuffer({
  1. required int width,
  2. required int height,
})

Creates a CanvasBuffer with the specified width and height.

Initializes the internal buffer with empty spaces.

Implementation

CanvasBuffer({required this.width, required this.height})
  : _screenBuffer = List.generate(
      height,
      (_) => List.filled(width, BufferCell(char: ' ')),
    ),
    _previousFrame = List.generate(
      height,
      (_) => List.filled(width, BufferCell(char: '')),
    );