为什么drawColor
(#1)调用会被裁剪,而paintChild
(#2)不会被裁剪?这在paint
子类的RenderSliverSingleBoxAdapter
方法中。
context.clipRRectAndPaint(
RRect.fromRectAndCorners(
offset & Size(paintBounds.width, paintBounds.height + 100.0),
topLeft: Radius.circular(topCornerRadius),
topRight: Radius.circular(topCornerRadius)),
Clip.antiAlias,
paintBounds, () {
// 1
context.canvas.drawColor(Colors.blue, BlendMode.srcOver);
// 2
context.paintChild(child, offset);
});