TwoDimensionalViewport constructor

const TwoDimensionalViewport(
  1. {Key? key,
  2. required ViewportOffset verticalOffset,
  3. required AxisDirection verticalAxisDirection,
  4. required ViewportOffset horizontalOffset,
  5. required AxisDirection horizontalAxisDirection,
  6. required TwoDimensionalChildDelegate delegate,
  7. required Axis mainAxis,
  8. double? cacheExtent,
  9. Clip clipBehavior = Clip.hardEdge}

Creates a viewport for RenderBox objects that extend and scroll in both horizontal and vertical dimensions.

The viewport listens to the horizontalOffset and verticalOffset, which means this widget does not need to be rebuilt when the offsets change.


const TwoDimensionalViewport({
  required this.verticalOffset,
  required this.verticalAxisDirection,
  required this.horizontalOffset,
  required this.horizontalAxisDirection,
  required this.delegate,
  required this.mainAxis,
  this.clipBehavior = Clip.hardEdge,
}) : assert(
       verticalAxisDirection == AxisDirection.down || verticalAxisDirection == AxisDirection.up,
       'TwoDimensionalViewport.verticalAxisDirection is not Axis.vertical.'
       horizontalAxisDirection == AxisDirection.left || horizontalAxisDirection == AxisDirection.right,
       'TwoDimensionalViewport.horizontalAxisDirection is not Axis.horizontal.'