rectOrNull property

Rect? get rectOrNull

rect, or null while this context has no laid-out box to measure.

Implementation

Rect? get rectOrNull {
  final box = findRenderObject();
  if (box is! RenderBox || !box.hasSize || !box.attached) return null;
  return box.localToGlobal(Offset.zero) & box.size;
}