debugPaintPadding function Null safety

void debugPaintPadding(
  1. Canvas canvas,
  2. Rect outerRect,
  3. Rect? innerRect,
  4. {double outlineWidth = 2.0}
)

Paint a diagram showing the given area as padding.

Called by RenderPadding.debugPaintSize when debugPaintSizeEnabled is true.

Implementation

void debugPaintPadding(Canvas canvas, Rect outerRect, Rect? innerRect, { double outlineWidth = 2.0 }) {
  assert(() {
    if (innerRect != null && !innerRect.isEmpty) {
      _debugDrawDoubleRect(canvas, outerRect, innerRect, const Color(0x900090FF));
      _debugDrawDoubleRect(canvas, innerRect.inflate(outlineWidth).intersect(outerRect), innerRect, const Color(0xFF0090FF));
    } else {
      final Paint paint = Paint()
        ..color = const Color(0x90909090);
      canvas.drawRect(outerRect, paint);
    }
    return true;
  }());
}