ShakeDetector class
ShakeDetector class for phone shake functionality
Constructors
- ShakeDetector.autoStart({required PhoneShakeCallback onPhoneShake, double shakeThresholdGravity = 2.7, int shakeSlopTimeMS = 500, int shakeCountResetTime = 3000, int minimumShakeCount = 1})
- This constructor automatically calls startListening and starts detection and callbacks.
- ShakeDetector.waitForStart({required PhoneShakeCallback onPhoneShake, double shakeThresholdGravity = 2.7, int shakeSlopTimeMS = 500, int shakeCountResetTime = 3000, int minimumShakeCount = 1})
- This constructor waits until startListening is called
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- minimumShakeCount → int
-
Number of shakes required before shake is triggered
final
- mShakeCount ↔ int
-
getter/setter pair
- mShakeTimestamp ↔ int
-
getter/setter pair
- onPhoneShake → PhoneShakeCallback
-
User callback for phone shake
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startListening(
) → void - Starts listening to accelerometer events
-
stopListening(
) → void - Stops listening to accelerometer events
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited