debugPaint method Null safety
- PaintingContext context,
- Offset offset
override
Override this method to paint debugging information.
Implementation
@override
void debugPaint(PaintingContext context, Offset offset) {
super.debugPaint(context, offset);
assert(() {
if (debugPaintSizeEnabled) {
final Size parentSize = getAbsoluteSize();
final Rect outerRect = offset & parentSize;
Rect? innerRect;
if (child != null) {
final Size childSize = child!.getAbsoluteSize();
final SliverPhysicalParentData childParentData = child!.parentData! as SliverPhysicalParentData;
innerRect = (offset + childParentData.paintOffset) & childSize;
assert(innerRect.top >= outerRect.top);
assert(innerRect.left >= outerRect.left);
assert(innerRect.right <= outerRect.right);
assert(innerRect.bottom <= outerRect.bottom);
}
debugPaintPadding(context.canvas, outerRect, innerRect);
}
return true;
}());
}