paint method
Called to draw the decoration around a span.
The provided SpanDecorationPaintDetails describes the bounds and orientation of the span that are currently visible inside the viewport. The extent of the actual span may be larger.
If a span contains pinned parts, paint is invoked separately for the pinned and unpinned parts. For example: If a row contains a pinned column, paint is called with the SpanDecorationPaintDetails.rect for the cell representing the pinned column and separately with another SpanDecorationPaintDetails.rect containing all the other unpinned cells.
Implementation
void paint(SpanDecorationPaintDetails details) {
if (color != null) {
final Paint paint = Paint()
..color = color!
..isAntiAlias = borderRadius != null;
if (borderRadius == null || borderRadius == BorderRadius.zero) {
details.canvas.drawRect(details.rect, paint);
} else {
details.canvas.drawRRect(
borderRadius!.toRRect(details.rect),
paint,
);
}
}
if (border != null) {
border!.paint(details, borderRadius);
}
}