debugPaintSize method Null safety

  1. @override
void debugPaintSize(
  1. PaintingContext context,
  2. Offset offset
)

In debug mode, paints a border around this render box.

Called for every RenderBox when debugPaintSizeEnabled is true.

Implementation

@override
void debugPaintSize(PaintingContext context, Offset offset) {
  assert(() {
    if (child != null) {
      super.debugPaintSize(context, offset);
      if (clipBehavior != Clip.none) {
        context.canvas.drawRect(_clip!.shift(offset), _debugPaint!);
        _debugText!.paint(context.canvas, offset + Offset(_clip!.width / 8.0, -_debugText!.text!.style!.fontSize! * 1.1));
      }
    }
    return true;
  }());
}