stickyPortOf function

RenderBox? stickyPortOf(
  1. RenderObject held
)

The box whose edges a box held inside it is held to: the nearest RenderStickyPort or RenderAbstractViewport round it -- a ScrollBox as a whole, not the view of each axis it scrolls in -- or the root where there is neither (Sticky).

Implementation

RenderBox? stickyPortOf(RenderObject held) {
  RenderBox? port;
  for (var p = held.parent; p != null; p = p.parent) {
    if (p is RenderBox) port = p;
    if (p is RenderScrollPort) continue;
    if (p is RenderAbstractViewport || p is RenderStickyPort) break;
  }
  return port;
}