RenderViewportBase<ParentDataClass extends ContainerParentDataMixin<RenderSliver> > constructor
Null safety
- {AxisDirection axisDirection = AxisDirection.down,
- required AxisDirection crossAxisDirection,
- required ViewportOffset offset,
- double? cacheExtent,
- CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
- 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(axisDirection != null),
assert(crossAxisDirection != null),
assert(offset != null),
assert(axisDirectionToAxis(axisDirection) != axisDirectionToAxis(crossAxisDirection)),
assert(cacheExtentStyle != null),
assert(cacheExtent != null || cacheExtentStyle == CacheExtentStyle.pixel),
assert(clipBehavior != null),
_axisDirection = axisDirection,
_crossAxisDirection = crossAxisDirection,
_offset = offset,
_cacheExtent = cacheExtent ?? RenderAbstractViewport.defaultCacheExtent,
_cacheExtentStyle = cacheExtentStyle,
_clipBehavior = clipBehavior;