flutter_crazy_fortune_wheel 1.0.1 copy "flutter_crazy_fortune_wheel: ^1.0.1" to clipboard
flutter_crazy_fortune_wheel: ^1.0.1 copied to clipboard

A Fortune wheel with different styles and animations.

flutter_crazy_fortune_wheel #

pub package

flutter_crazy_fortune_wheel

Getting Started #

If you use the SlicedWheel (or the RandomWheel), you will need to add this shader to your pubspec.yaml:

flutter:
  shaders:
    - packages/flutter_crazy_fortune_wheel/shaders/sliced_wheel_shader.frag

Create an animationController, and optionally "drive" it using FortuneWheelCurve to improve the animation:

  late final controller = AnimationController(
    vsync: this,
    duration: const Duration(seconds: 10),
  );
  late final animation = controller.drive(CurveTween(curve: FortuneWheelCurve()));

Create the wheel:

NormalWheel( // or SlicedWheel, DisappearingWheel, or RandomWheel
    animation: animation, // AnimationController or animation<double>
    winnerIndex: winnerIndex, // For example: winnerIndex = Random.secure().nextInt(childrenMedium.length);
    children: children, // The widgets that will be displayed on the wheel
),
7
likes
150
points
35
downloads

Publisher

verified publisherwive.be

Weekly Downloads

A Fortune wheel with different styles and animations.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_shader_snap, flutter_shaders

More

Packages that depend on flutter_crazy_fortune_wheel