|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Runtime.CompilerServices; |
|
|
|
using Unity.UIWidgets.animation; |
|
|
|
using Unity.UIWidgets.async2; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
List<Future> futures = new List<Future>(); |
|
|
|
foreach (_FixedExtentScrollPosition position in positions) { |
|
|
|
foreach (_FixedExtentScrollPosition position in positions.Cast<_FixedExtentScrollPosition>()) { |
|
|
|
futures.Add(position.animateTo( |
|
|
|
itemIndex * position.itemExtent, |
|
|
|
duration: duration, |
|
|
|
|
|
|
float offAxisFraction = 0.0f, |
|
|
|
bool useMagnifier = false, |
|
|
|
float magnification = 1.0f, |
|
|
|
float overAndUnderCenterOpacity = 1.0f, |
|
|
|
float squeeze = 1.0f, |
|
|
|
ValueChanged<int> onSelectedItemChanged = null, |
|
|
|
bool clipToSize = true, |
|
|
|
bool renderChildrenOutsideViewport = false, |
|
|
|
|
|
|
D.assert(perspective > 0); |
|
|
|
D.assert(perspective <= 0.01f, () => RenderListWheelViewport.perspectiveTooHighMessage); |
|
|
|
D.assert(magnification > 0); |
|
|
|
D.assert(overAndUnderCenterOpacity != null); |
|
|
|
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1); |
|
|
|
D.assert(squeeze != null); |
|
|
|
D.assert(squeeze > 0); |
|
|
|
D.assert( |
|
|
|
!renderChildrenOutsideViewport || !clipToSize, |
|
|
|
() => RenderListWheelViewport.clipToSizeAndRenderChildrenOutsideViewportConflict |
|
|
|
|
|
|
this.overAndUnderCenterOpacity = overAndUnderCenterOpacity; |
|
|
|
this.squeeze = squeeze; |
|
|
|
this.controller = controller; |
|
|
|
this.physics = physics; |
|
|
|
this.diameterRatio = diameterRatio; |
|
|
|
|
|
|
|
|
|
|
public static ListWheelScrollView useDelegate( |
|
|
|
float itemExtent, |
|
|
|
float overAndUnderCenterOpacity = 1.0f, |
|
|
|
float squeeze = 1.0f, |
|
|
|
List<Widget> children = null, |
|
|
|
ListWheelChildDelegate childDelegate = null, |
|
|
|
Key key = null, |
|
|
|
|
|
|
public readonly bool useMagnifier; |
|
|
|
public readonly float magnification; |
|
|
|
public readonly float itemExtent; |
|
|
|
public readonly float overAndUnderCenterOpacity; |
|
|
|
public readonly float squeeze; |
|
|
|
public readonly ValueChanged<int> onSelectedItemChanged; |
|
|
|
public readonly bool clipToSize; |
|
|
|
public readonly bool renderChildrenOutsideViewport; |
|
|
|
|
|
|
offAxisFraction: widget.offAxisFraction, |
|
|
|
useMagnifier: widget.useMagnifier, |
|
|
|
magnification: widget.magnification, |
|
|
|
overAndUnderCenterOpacity: widget.overAndUnderCenterOpacity, |
|
|
|
squeeze: widget.squeeze, |
|
|
|
clipToSize: widget.clipToSize, |
|
|
|
renderChildrenOutsideViewport: widget.renderChildrenOutsideViewport, |
|
|
|
offset: _offset, |
|
|
|
|
|
|
|
|
|
|
internal override void forgetChild(Element child) { |
|
|
|
_childElements.Remove((int) (child.slot)); |
|
|
|
base.forgetChild(child); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
bool useMagnifier = false, |
|
|
|
float magnification = 1.0f, |
|
|
|
bool clipToSize = true, |
|
|
|
bool renderChildrenOutsideViewport = false |
|
|
|
bool renderChildrenOutsideViewport = false, |
|
|
|
float overAndUnderCenterOpacity = 1.0f, |
|
|
|
float squeeze = 1.0f |
|
|
|
) : base(key: key) { |
|
|
|
D.assert(childDelegate != null); |
|
|
|
D.assert(offset != null); |
|
|
|
|
|
|
D.assert(overAndUnderCenterOpacity != null); |
|
|
|
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1); |
|
|
|
D.assert(itemExtent > 0); |
|
|
|
D.assert( |
|
|
|
!renderChildrenOutsideViewport || !clipToSize, |
|
|
|
|
|
|
this.magnification = magnification; |
|
|
|
this.clipToSize = clipToSize; |
|
|
|
this.renderChildrenOutsideViewport = renderChildrenOutsideViewport; |
|
|
|
this.overAndUnderCenterOpacity = overAndUnderCenterOpacity; |
|
|
|
this.squeeze = squeeze; |
|
|
|
} |
|
|
|
|
|
|
|
public readonly float diameterRatio; |
|
|
|
|
|
|
public readonly float magnification; |
|
|
|
public readonly float overAndUnderCenterOpacity; |
|
|
|
public readonly float squeeze; |
|
|
|
public readonly bool clipToSize; |
|
|
|
public readonly bool renderChildrenOutsideViewport; |
|
|
|
public readonly ViewportOffset offset; |
|
|
|
|
|
|
offAxisFraction: offAxisFraction, |
|
|
|
useMagnifier: useMagnifier, |
|
|
|
magnification: magnification, |
|
|
|
overAndUnderCenterOpacity: overAndUnderCenterOpacity, |
|
|
|
squeeze: squeeze, |
|
|
|
clipToSize: clipToSize, |
|
|
|
renderChildrenOutsideViewport: renderChildrenOutsideViewport |
|
|
|
); |
|
|
|
|
|
|
viewport.offAxisFraction = offAxisFraction; |
|
|
|
viewport.useMagnifier = useMagnifier; |
|
|
|
viewport.magnification = magnification; |
|
|
|
viewport.overAndUnderCenterOpacity = overAndUnderCenterOpacity; |
|
|
|
viewport.squeeze = squeeze; |
|
|
|
viewport.clipToSize = clipToSize; |
|
|
|
viewport.renderChildrenOutsideViewport = renderChildrenOutsideViewport; |
|
|
|
} |