Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wheel can be spun manually to a prize #6

Open
zanesc opened this issue Jul 13, 2020 · 2 comments
Open

Wheel can be spun manually to a prize #6

zanesc opened this issue Jul 13, 2020 · 2 comments

Comments

@zanesc
Copy link

zanesc commented Jul 13, 2020

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.

@waletoyo1
Copy link

Hi, have you been able to solve this problem? I'm facing same.

@xalife
Copy link

xalife commented Apr 28, 2021

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, ), ), ], ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants