buildViewport method

  1. @protected
Widget buildViewport (BuildContext context, ViewportOffset offset, AxisDirection axisDirection, List<Widget> slivers)
@protected

Build the viewport.

Subclasses may override this method to change how the viewport is built. The default implementation uses a ShrinkWrappingViewport if shrinkWrap is true, and a regular Viewport otherwise.

Implementation

@protected
Widget buildViewport(
  BuildContext context,
  ViewportOffset offset,
  AxisDirection axisDirection,
  List<Widget> slivers,
) {
  if (shrinkWrap) {
    return ShrinkWrappingViewport(
      axisDirection: axisDirection,
      offset: offset,
      slivers: slivers,
    );
  }
  return Viewport(
    axisDirection: axisDirection,
    offset: offset,
    slivers: slivers,
    cacheExtent: cacheExtent,
  );
}