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