RenderViewportBase<ParentDataClass extends ContainerParentDataMixin<RenderSliver>> constructor

RenderViewportBase<ParentDataClass extends ContainerParentDataMixin<RenderSliver>>(
  1. {AxisDirection axisDirection = AxisDirection.down,
  2. required AxisDirection crossAxisDirection,
  3. required ViewportOffset offset,
  4. double? cacheExtent,
  5. CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
  6. Clip clipBehavior = Clip.hardEdge}
)

Initializes fields for subclasses.

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

The cacheExtent must be specified if cacheExtentStyle is not CacheExtentStyle.pixel.

Implementation

RenderViewportBase({
  AxisDirection axisDirection = AxisDirection.down,
  required AxisDirection crossAxisDirection,
  required ViewportOffset offset,
  double? cacheExtent,
  CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
  Clip clipBehavior = Clip.hardEdge,
}) : assert(axisDirectionToAxis(axisDirection) != axisDirectionToAxis(crossAxisDirection)),
     assert(cacheExtent != null || cacheExtentStyle == CacheExtentStyle.pixel),
     _axisDirection = axisDirection,
     _crossAxisDirection = crossAxisDirection,
     _offset = offset,
     _cacheExtent = cacheExtent ?? RenderAbstractViewport.defaultCacheExtent,
     _cacheExtentStyle = cacheExtentStyle,
     _clipBehavior = clipBehavior;