ShakeDetector class Null safety

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.
read-onlyinherited
minimumShakeCount int
Number of shakes required before shake is triggered
final
mShakeCount int
read / write
mShakeTimestamp int
read / write
onPhoneShake PhoneShakeCallback
User callback for phone shake
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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