drawChar method
void
drawChar(
- int column,
- int line,
- String char, {
- AnsiColorType? fg,
- AnsiColorType? bg,
- Set<
FontStyle> ? styles,
Draws a single character at position (column
, line
) with optional style.
If the character is whitespace, the style is cleared. Ignores drawing if coordinates are out of bounds.
Implementation
void drawChar(
int column,
int line,
String char, {
AnsiColorType? fg,
AnsiColorType? bg,
Set<FontStyle>? styles,
}) {
if (column >= 0 && column < width && line >= 0 && line < height) {
final Set<FontStyle> effectiveStyle = (char.trim().isEmpty)
? {}
: (styles ?? {});
_screenBuffer[line][column] = BufferCell(
char: char,
fg: fg,
bg: bg,
styles: effectiveStyle,
);
}
}