getWidgetBoundingBox function

Rect? getWidgetBoundingBox(
  1. BuildContext context
)

Implementation

Rect? getWidgetBoundingBox(BuildContext context) {
  try {
    final renderBox = context.findRenderObject() as RenderBox?;
    return renderBox!.localToGlobal(Offset.zero) & renderBox.size;
  } catch (_) {
    return null;
  }
}