flutter-spinning-wheel
flutter-spinning-wheel copied to clipboard
Wheel can be spun manually to a prize
Am i missing something here? This wheel can be spun with your finger to what ever section of the wheel you want and then the onEnd is called allowing the user to select which prize they want to win.
Also, onEnd is called when the user starts spinning the wheel and when the wheel ends.
Hi, have you been able to solve this problem? I'm facing same.
hello, you can put the wheelspinner into a Stack widget with a container on top of each other but container should be on top, and container must have transparent color so it basicly prevents any touches to a spinner directly.
Stack( fit: StackFit.expand, children: [ Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SpinningWheel( Image.asset('assets/images/wheel-6-300.png'), width: 310, height: 310, initialSpinAngle: _generateRandomAngle(), spinResistance: 0.2, dividers: 6, canInteractWhileSpinning: false, onUpdate: _dividerController.add, onEnd: _dividerController.add, shouldStartOrStop: _wheelNotifier.stream, ), StreamBuilder( stream: _dividerController.stream, builder: (context, snapshot) => snapshot.hasData ? BasicScore(snapshot.data) : Container(), ), FancyButton( child: Text("çevir"), size: 64, color: Colors.deepPurple, onPressed: () { setState(() { _wheelNotifier.sink.add(_generateRandomVelocity()); }); }, ) ], ), Center( child: Container( margin: EdgeInsets.only(bottom: 60), width: 310, height: 310, color: Colors.transparent, ), ), ], ),