final rect = localToGlobal(Offset.zero);
Offset globalPosition() {
var accumulatedOffset = Offset.zero;
AbstractNode? node = this;
while (node != null) {
if (node is RenderBox) {
AbstractNode? ancestor = node.parent;
while (ancestor != null) {
if (ancestor is RenderObject) {
break;
}
ancestor = ancestor.parent;
}
if (ancestor != null) {
final offset = node.localToGlobal(Offset.zero, ancestor: ancestor as RenderObject);
accumulatedOffset += offset;
}
}
node = node.parent as RenderObject?;
}
return accumulatedOffset;
}
HeroStillRenderObject: Offset(0.0, 0.0), summed: Offset(0.0, 0.0)
RenderConstrainedBox: Offset(0.0, 171.5), summed: Offset(0.0, 171.5)
RenderFlex: Offset(4.0, 4.0), summed: Offset(4.0, 175.5)
RenderPadding: Offset(623.5, 407.0), summed: Offset(627.5, 582.5)
RenderStack: Offset(0.0, 0.0), summed: Offset(627.5, 582.5)
HeroSceneMarkerRenderObject: Offset(0.0, 0.0), summed: Offset(627.5, 582.5)
RenderConstrainedBox: Offset(0.0, 56.0), summed: Offset(627.5, 638.5)
RenderCustomMultiChildLayoutBox: Offset(0.0, 0.0), summed: Offset(627.5, 638.5)
Offset globalPosition() {
AbstractNode? node = this;
while (node != null) {
if (node is HeroSceneMarkerRenderObject) {
return localToGlobal(Offset.zero, ancestor: node);
}
node = node.parent as RenderObject?;
}
return Offset.zero;
}