RenderTwoDimensionalViewport constructor
- 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,
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;
}());
}