ShakeDetector class
ShakeDetector class for phone shake functionality
Constructors
- ShakeDetector.autoStart({PhoneShakeCallback onPhoneShake, double shakeThresholdGravity: 2.7, int shakeSlopTimeMS: 500, int shakeCountResetTime: 3000 })
- This constructor automatically calls startListening and starts detection and callbacks.\
- ShakeDetector.waitForStart({PhoneShakeCallback onPhoneShake, double shakeThresholdGravity: 2.7, int shakeSlopTimeMS: 500, int shakeCountResetTime: 3000 })
- This constructor waits until startListening is called
Properties
- mShakeCount ↔ int
-
read / write
- mShakeTimestamp ↔ int
-
read / write
- onPhoneShake → PhoneShakeCallback
-
User callback for phone shake
final
- shakeCountResetTime → int
-
Time before shake count resets
final
- shakeSlopTimeMS → int
-
Minimum time between shake
final
- shakeThresholdGravity → double
-
Shake detection threshold
final
- streamSubscription ↔ StreamSubscription
-
StreamSubscription for Accelerometer events
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
startListening(
) → void - Starts listening to accerelometer events
-
stopListening(
) → void - Stops listening to accelerometer events
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited