debugPaintSize method

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

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(() {
    _debugPaint ??= Paint()
      ..shader = ui.Gradient.linear(
        const Offset(0.0, 0.0),
        const Offset(10.0, 10.0),
        <Color>[const Color(0x00000000), const Color(0xFFFF00FF), const Color(0xFFFF00FF), const Color(0x00000000)],
        <double>[0.25, 0.25, 0.75, 0.75],
        TileMode.repeated,
      )
      ..strokeWidth = 2.0
      ..style = PaintingStyle.stroke;
    _debugText ??= TextPainter(
      text: const TextSpan(
        text: '✂',
        style: TextStyle(
          color: Color(0xFFFF00FF),
            fontSize: 14.0,
          ),
        ),
        textDirection: TextDirection.rtl, // doesn't matter, it's one character
      )
      ..layout();
    return true;
  }());
}