ListWheelViewport constructor
- 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.
The perspective
argument defaults to 0.003.
The itemExtent
argument in pixels must be provided and must be positive.
The clipBehavior
argument defaults to Clip.hardEdge.
The renderChildrenOutsideViewport
argument defaults to false and must
not be null.
The offset
argument must be provided.
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(diameterRatio > 0, RenderListWheelViewport.diameterRatioZeroMessage),
assert(perspective > 0),
assert(perspective <= 0.01, RenderListWheelViewport.perspectiveTooHighMessage),
assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1),
assert(itemExtent > 0),
assert(squeeze > 0),
assert(
!renderChildrenOutsideViewport || clipBehavior == Clip.none,
RenderListWheelViewport.clipBehaviorAndRenderChildrenOutsideViewportConflict,
);