globalPaintBounds property

Rect? get globalPaintBounds

Implementation

Rect? get globalPaintBounds {
  final ctx = this.currentContext;
  if (ctx == null) return null;

  final renderBox = ctx.findRenderObject() as RenderBox?;
  if (renderBox == null) return null;

  final r = Rect.fromLTWH(
    renderBox.localToGlobal(Offset.zero).dx,
    renderBox.localToGlobal(Offset.zero).dy,
    renderBox.size.width,
    renderBox.size.height
  );

  return r;
}