paint method
Default paint implementation.
RenderBox paints no self-content; it forwards painting to its RenderBox children. Subclasses override to draw their own content.
Implementation
@override
void paint(PaintingContext context, Offset offset) {
if (!_clip) {
super.paint(context, offset);
return;
}
context.canvas.save();
try {
context.canvas.clipRect(
Rect.fromLTWH(offset.dx + x, offset.dy + y, size.width, size.height),
);
super.paint(context, offset);
} finally {
context.canvas.restore();
}
}