FortuneBar constructor

FortuneBar({
  1. Key? key,
  2. double height = 56.0,
  3. Duration duration = FortuneWidget.kDefaultDuration,
  4. VoidCallback? onAnimationStart,
  5. VoidCallback? onAnimationEnd,
  6. Curve curve = FortuneCurve.spin,
  7. required Stream<int> selected,
  8. int rotationCount = FortuneWidget.kDefaultRotationCount,
  9. required List<FortuneItem> items,
  10. List<FortuneIndicator> indicators = kDefaultIndicators,
  11. bool fullWidth = false,
  12. StyleStrategy styleStrategy = kDefaultStyleStrategy,
  13. bool animateFirst = true,
  14. int visibleItemCount = kDefaultVisibleItemCount,
  15. VoidCallback? onFling,
  16. 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);