SliverGeometry constructor

const SliverGeometry({
  1. double scrollExtent = 0.0,
  2. double paintExtent = 0.0,
  3. double paintOrigin = 0.0,
  4. double? layoutExtent,
  5. double maxPaintExtent = 0.0,
  6. double maxScrollObstructionExtent = 0.0,
  7. double? crossAxisExtent,
  8. double? hitTestExtent,
  9. bool? visible,
  10. bool hasVisualOverflow = false,
  11. double? scrollOffsetCorrection,
  12. double? cacheExtent,
})

Creates an object that describes the amount of space occupied by a sliver.

If the layoutExtent argument is null, layoutExtent defaults to the paintExtent. If the hitTestExtent argument is null, hitTestExtent defaults to the paintExtent. If visible is null, visible defaults to whether paintExtent is greater than zero.

Implementation

const SliverGeometry({
  this.scrollExtent = 0.0,
  this.paintExtent = 0.0,
  this.paintOrigin = 0.0,
  double? layoutExtent,
  this.maxPaintExtent = 0.0,
  this.maxScrollObstructionExtent = 0.0,
  this.crossAxisExtent,
  double? hitTestExtent,
  bool? visible,
  this.hasVisualOverflow = false,
  this.scrollOffsetCorrection,
  double? cacheExtent,
}) : assert(scrollOffsetCorrection != 0.0),
     layoutExtent = layoutExtent ?? paintExtent,
     hitTestExtent = hitTestExtent ?? paintExtent,
     cacheExtent = cacheExtent ?? layoutExtent ?? paintExtent,
     visible = visible ?? paintExtent > 0.0;