TwoDimensionalViewport constructor
- Key? key,
- required ViewportOffset verticalOffset,
- required AxisDirection verticalAxisDirection,
- required ViewportOffset horizontalOffset,
- required AxisDirection horizontalAxisDirection,
- required TwoDimensionalChildDelegate delegate,
- required Axis mainAxis,
- double? cacheExtent,
- 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.
Implementation
const TwoDimensionalViewport({
super.key,
required this.verticalOffset,
required this.verticalAxisDirection,
required this.horizontalOffset,
required this.horizontalAxisDirection,
required this.delegate,
required this.mainAxis,
this.cacheExtent,
this.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.'
);