buildViewport method

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

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 new ShrinkWrappingViewport(
      axisDirection: axisDirection,
      offset: offset,
      slivers: slivers,
    );
  }
  return new Viewport(
    axisDirection: axisDirection,
    offset: offset,
    slivers: slivers,
    cacheExtent: cacheExtent,
  );
}