globalPaintBounds property

Rect? globalPaintBounds

Returns the paint bounds of the widget in global coordinates.

Implementation

Rect? get globalPaintBounds {
  final renderObject = findRenderObject();
  final translation = renderObject?.getTransformTo(null).getTranslation();
  if (translation != null && renderObject?.paintBounds != null) {
    return renderObject!.paintBounds.shift(
      Offset(translation.x, translation.y),
    );
  } else {
    return null;
  }
}