ListWheelViewport constructor Null safety
- {Key? key,
- double diameterRatio = RenderListWheelViewport.defaultDiameterRatio,
- double perspective = RenderListWheelViewport.defaultPerspective,
- double offAxisFraction = 0.0,
- bool useMagnifier = false,
- double magnification = 1.0,
- double overAndUnderCenterOpacity = 1.0,
- required double itemExtent,
- double squeeze = 1.0,
- bool renderChildrenOutsideViewport = false,
- required ViewportOffset offset,
- required ListWheelChildDelegate childDelegate,
- Clip clipBehavior = Clip.hardEdge}
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({
super.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,
);