ListWheelViewport constructor Null safety

const ListWheelViewport(
  1. {Key? key,
  2. double diameterRatio,
  3. double perspective,
  4. double offAxisFraction,
  5. bool useMagnifier,
  6. double magnification,
  7. double overAndUnderCenterOpacity,
  8. required double itemExtent,
  9. double squeeze,
  10. bool renderChildrenOutsideViewport,
  11. required ViewportOffset offset,
  12. required ListWheelChildDelegate childDelegate,
  13. Clip clipBehavior}
)

Creates a viewport where children are rendered onto a wheel.

The diameterRatio argument defaults to 2.0 and must not be null.

The perspective argument defaults to 0.003 and must not be null.

The itemExtent argument in pixels must be provided and must be positive.

The clipBehavior argument defaults to Clip.hardEdge and must not be null.

The renderChildrenOutsideViewport argument defaults to false and must not be null.

The offset argument must be provided and must not be null.

Implementation

const ListWheelViewport({
  Key? key,
  this.diameterRatio = RenderListWheelViewport.defaultDiameterRatio,
  this.perspective = RenderListWheelViewport.defaultPerspective,
  this.offAxisFraction = 0.0,
  this.useMagnifier = false,
  this.magnification = 1.0,
  this.overAndUnderCenterOpacity = 1.0,
  required this.itemExtent,
  this.squeeze = 1.0,
  this.renderChildrenOutsideViewport = false,
  required this.offset,
  required this.childDelegate,
  this.clipBehavior = Clip.hardEdge,
}) : assert(childDelegate != null),
     assert(offset != null),
     assert(diameterRatio != null),
     assert(diameterRatio > 0, RenderListWheelViewport.diameterRatioZeroMessage),
     assert(perspective != null),
     assert(perspective > 0),
     assert(perspective <= 0.01, RenderListWheelViewport.perspectiveTooHighMessage),
     assert(overAndUnderCenterOpacity != null),
     assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1),
     assert(itemExtent != null),
     assert(itemExtent > 0),
     assert(squeeze != null),
     assert(squeeze > 0),
     assert(renderChildrenOutsideViewport != null),
     assert(clipBehavior != null),
     assert(
       !renderChildrenOutsideViewport || clipBehavior == Clip.none,
       RenderListWheelViewport.clipBehaviorAndRenderChildrenOutsideViewportConflict,
     ),
     super(key: key);