In this article, we are going to make custom spin the wheel for flutter application. You can also check out flutter related articles.
We are displaying football players names in spinwheel in this flutter example. So users can spin the wheel and check who is their favourite football player. To create spin wheel with customization, we are using flutter_spinwheel package.
SpinWheel can move by two ways. First way we can move it in any clockwise/anticlockwise direction. Other way is to tap on spin wheel, SpinWheel will move. SpinWheel widget has many different properties. We can also autoplay spinwheel by giving value true to autoplay property of spinwheel widget.
hideOthers property is used to all option except selected option. We can also display border using shouldDrawBorder property. onChange callback is used to detect when spinwheel selected option has been changed. We can get selected value from this callback.
We can display choices related to question using items property of Spinwheel widget. So users can decide one from them by spin the wheel. itemCount property is used to give number of items to Spinwheel widget. We can also highlight any option by default using select property of Spinwheel widget.