of method

RenderAbstractViewport of (RenderObject object)

Returns the RenderAbstractViewport that most tightly encloses the given render object.

If the object does not have a RenderAbstractViewport as an ancestor, this function returns null.

Implementation

static RenderAbstractViewport of(RenderObject object) {
  while (object != null) {
    if (object is RenderAbstractViewport)
      return object;
    object = object.parent;
  }
  return null;
}