FortuneWheel constructor
FortuneWheel({
- Key? key,
- required List<
FortuneItem> items, - int rotationCount = FortuneWidget.kDefaultRotationCount,
- Stream<
int> selected = const Stream<int>.empty(), - Duration duration = FortuneWidget.kDefaultDuration,
- Curve curve = FortuneCurve.spin,
- List<
FortuneIndicator> indicators = kDefaultIndicators, - StyleStrategy styleStrategy = kDefaultStyleStrategy,
- bool animateFirst = true,
- VoidCallback? onAnimationStart,
- VoidCallback? onAnimationEnd,
- PanPhysics? physics,
- VoidCallback? onFling,
Creates a new FortuneWheel with the given items, which is centered on the selected value.
{@macro flutter_fortune_wheel.FortuneWidget.ctorArgs}.
See also:
- FortuneBar, which provides an alternative visualization.
Implementation
FortuneWheel({
Key? key,
required this.items,
this.rotationCount = FortuneWidget.kDefaultRotationCount,
this.selected = const Stream<int>.empty(),
this.duration = FortuneWidget.kDefaultDuration,
this.curve = FortuneCurve.spin,
this.indicators = kDefaultIndicators,
this.styleStrategy = kDefaultStyleStrategy,
this.animateFirst = true,
this.onAnimationStart,
this.onAnimationEnd,
PanPhysics? physics,
this.onFling,
}) : physics = physics ?? CircularPanPhysics(),
assert(items != null && items.length > 1),
assert(curve != null),
super(key: key);