findViewport method

RenderViewport? findViewport(
  1. BuildContext? context
)

Implementation

RenderViewport? findViewport(BuildContext? context) {
  if (context == null) {
    return null;
  }
  RenderViewport? result;
  context.visitChildElements((Element e) {
    final RenderObject? renderObject = e.findRenderObject();
    if (renderObject is RenderViewport) {
      assert(result == null);
      result = renderObject;
    } else {
      result = findViewport(e);
    }
  });
  return result;
}