shake_tune
This is a plugin that provides a randomizer while shaking the phone.
Features
- Shake Detection
- Customizable Actions
- Randomization
- Configuration Options
How to use
To listen to shaking of phone (automatically calls startListening):
shakeDetector = ShakeDetector.autoStart(onPhoneShake: handleShake);
To listen to shaking of phone (waits until startListening is called):
shakeDetector = ShakeDetector.waitForStart(onPhoneShake: handleShake);
To stop listening:
shakeDetector.stopListening();
ShakeTune widget contains:
childrenarray - all results that randomizer may give (must not benull)probabilitiesarray - probabilities for each element inchildren(the length shall be equal to length of thechildrenarray, and the sum of all elements shall be equal to one)callback- call when phone shookfirstElementShownOnlyOnce- property that defines if first element shows only on first start (before shake)alwaysChooseDifferentElement- property that defines if we should choose different element on every shake
