RenderViewportBase<ParentDataClass extends ContainerParentDataMixin<RenderSliver> > constructor
- AxisDirection axisDirection = AxisDirection.down,
- required AxisDirection crossAxisDirection,
- required ViewportOffset offset,
- @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') double? cacheExtent,
- @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
- ScrollCacheExtent? scrollCacheExtent,
- SliverPaintOrder paintOrder = SliverPaintOrder.firstIsTop,
- Clip clipBehavior = Clip.hardEdge,
Initializes fields for subclasses.
The scrollCacheExtent sets the amount of scrollable content that is
cached.
Implementation
RenderViewportBase({
AxisDirection axisDirection = AxisDirection.down,
required AxisDirection crossAxisDirection,
required ViewportOffset offset,
@Deprecated(
'Use scrollCacheExtent instead. '
'This feature was deprecated after v3.41.0-0.0.pre.',
)
double? cacheExtent,
@Deprecated(
'Use scrollCacheExtent instead. '
'This feature was deprecated after v3.41.0-0.0.pre.',
)
CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
ScrollCacheExtent? scrollCacheExtent,
SliverPaintOrder paintOrder = SliverPaintOrder.firstIsTop,
Clip clipBehavior = Clip.hardEdge,
}) : assert(axisDirectionToAxis(axisDirection) != axisDirectionToAxis(crossAxisDirection)),
assert(cacheExtent != null || cacheExtentStyle == CacheExtentStyle.pixel),
_axisDirection = axisDirection,
_crossAxisDirection = crossAxisDirection,
_offset = offset,
_scrollCacheExtent =
scrollCacheExtent ??
switch (cacheExtentStyle) {
CacheExtentStyle.pixel => ScrollCacheExtent.pixels(
cacheExtent ?? RenderAbstractViewport.defaultCacheExtent,
),
CacheExtentStyle.viewport => ScrollCacheExtent.viewport(cacheExtent!),
},
_paintOrder = paintOrder,
_clipBehavior = clipBehavior;