debugPaintSize method Null safety

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

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) {
  super.debugPaintSize(context, offset);
  assert(() {
    final Paint paint;
    if (child == null || child!.size.isEmpty) {
      paint = Paint()
        ..color = const Color(0x90909090);
      context.canvas.drawRect(offset & size, paint);
    }
    return true;
  }());
}