paintBounds static method

void paintBounds(
  1. Canvas canvas,
  2. Rect bounds,
  3. Color color
)

Paint debug bounds for a widget

Implementation

static void paintBounds(Canvas canvas, Rect bounds, Color color) {
  if (_showSugarWidgetBounds) {
    final paint = Paint()
      ..color = color.withValues(alpha: 0.3)
      ..style = PaintingStyle.stroke
      ..strokeWidth = 1.0;

    canvas.drawRect(bounds, paint);

    // Paint center point
    canvas.drawCircle(
      bounds.center,
      2.0,
      Paint()..color = color,
    );
  }
}