Skip to content

This is a package to help you create your lucky wheel (spinning widget) easily and effectively

License

Notifications You must be signed in to change notification settings

nguyencse/luckywheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easier to create your Lucky Wheel!

Getting Started

To use this plugin, add luckywheel as a dependency in your pubspec.yaml file.

See the example to get started quickly. To generate the platform folders run:

flutter create .

in the example folder.

To begin you need to instantiate a LuckyWheelController variable and pass in a controller argument of LuckyWheel widget.

LuckyWheelController _wheelController = LuckyWheelController(
  vsync: this,
  totalParts: 8,
  onRotationEnd: (idx) {
    _result.value = idx;
  },
);

After that, you can easily use the LuckyWheel Widget with the code below.

LuckyWheel(
  controller: _wheelController,
  onResult: (result) {
    _result.value = result;
  },
  child: const SpinningWidget(width: 300, height: 300, totalParts: 8),
  // child: Image.asset('images/wheel.png', width: 300, height: 300),
),

Enjoy the Lucky Wheel.

About

This is a package to help you create your lucky wheel (spinning widget) easily and effectively

Resources

License

Stars

Watchers

Forks

Languages