paint method

  1. @override
void paint(
  1. PaintingContext context,
  2. Offset offset
)
override

Paints this render object into the given context at offset.

Implementation

@override
void paint(PaintingContext context, Offset offset) {
  _cachedStyle ??= TextStyle(color: _color);
  final TextStyle textStyle = _cachedStyle!;
  final lineChar = character.isNotEmpty ? character[0] : '─';

  for (int y = 0; y < thickness && y < dividerHeight; y++) {
    for (int x = 0; x < size!.width; x++) {
      context.buffer.writeStyled(
        offset.x + x,
        offset.y + y,
        lineChar,
        textStyle,
      );
    }
  }
}