maybeOf static method

RenderAbstractViewport? maybeOf(
  1. 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.

See also:

Implementation

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