ShrinkWrappingViewport constructor

const ShrinkWrappingViewport({
  1. Key? key,
  2. AxisDirection axisDirection = AxisDirection.down,
  3. AxisDirection? crossAxisDirection,
  4. required ViewportOffset offset,
  5. SliverPaintOrder paintOrder = SliverPaintOrder.firstIsTop,
  6. Clip clipBehavior = Clip.hardEdge,
  7. @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') double? cacheExtent,
  8. @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
  9. ScrollCacheExtent? scrollCacheExtent,
  10. List<Widget> slivers = const <Widget>[],
})

Creates a widget that is bigger on the inside and shrink wraps its children in the main axis.

The viewport listens to the offset, which means you do not need to rebuild this widget when the offset changes.

Implementation

const ShrinkWrappingViewport({
  super.key,
  this.axisDirection = AxisDirection.down,
  this.crossAxisDirection,
  required this.offset,
  this.paintOrder = SliverPaintOrder.firstIsTop,
  this.clipBehavior = Clip.hardEdge,
  @Deprecated(
    'Use scrollCacheExtent instead. '
    'This feature was deprecated after v3.41.0-0.0.pre.',
  )
  this.cacheExtent,
  @Deprecated(
    'Use scrollCacheExtent instead. '
    'This feature was deprecated after v3.41.0-0.0.pre.',
  )
  this.cacheExtentStyle = CacheExtentStyle.pixel,
  this.scrollCacheExtent,
  List<Widget> slivers = const <Widget>[],
}) : super(children: slivers);