setChar method

void setChar(
  1. int x,
  2. int y,
  3. String char
)

Set a character at the specified coordinates

Implementation

void setChar(int x, int y, String char) {
  final index = _getIndex(x, y);
  if (char.isEmpty) throw ArgumentError('Character cannot be empty');

  chars[index] = char.runes.first;
}