globalBoundsOf function
The global bounds of box as painted now, or null when it or any
render object above it hasn't been laid out yet: a transition that
starts inserts a wrapper the frame lays out (#159).
Implementation
Rect? globalBoundsOf(RenderBox box) {
if (!box.attached) return null;
for (RenderObject? ro = box; ro != null; ro = ro.parent) {
if (ro is RenderBox && !ro.hasSize) return null;
}
return MatrixUtils.transformRect(
box.getTransformTo(null),
Offset.zero & box.size,
);
}