ShakeDetector class Null safety

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

hashCode int
The hash code for this object. [...]
read-only, inherited
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-only, inherited
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

dispose() → void
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