RenderTwoDimensionalViewport constructor

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

Initializes fields for subclasses.

The cacheExtent, if null, defaults to RenderAbstractViewport.defaultCacheExtent.

Implementation

RenderTwoDimensionalViewport({
  required ViewportOffset horizontalOffset,
  required AxisDirection horizontalAxisDirection,
  required ViewportOffset verticalOffset,
  required AxisDirection verticalAxisDirection,
  required TwoDimensionalChildDelegate delegate,
  required Axis mainAxis,
  required TwoDimensionalChildManager childManager,
  double? cacheExtent,
  Clip clipBehavior = Clip.hardEdge,
}) : assert(
       verticalAxisDirection == AxisDirection.down || verticalAxisDirection == AxisDirection.up,
       'TwoDimensionalViewport.verticalAxisDirection is not Axis.vertical.'
     ),
     assert(
       horizontalAxisDirection == AxisDirection.left || horizontalAxisDirection == AxisDirection.right,
       'TwoDimensionalViewport.horizontalAxisDirection is not Axis.horizontal.'
     ),
     _childManager = childManager,
     _horizontalOffset = horizontalOffset,
     _horizontalAxisDirection = horizontalAxisDirection,
     _verticalOffset = verticalOffset,
     _verticalAxisDirection = verticalAxisDirection,
     _delegate = delegate,
     _mainAxis = mainAxis,
     _cacheExtent = cacheExtent ?? RenderAbstractViewport.defaultCacheExtent,
     _clipBehavior = clipBehavior {
  assert(() {
    _debugDanglingKeepAlives = <RenderBox>[];
    return true;
  }());
}