ShakeDetector class

Detects a shake in accelerometer samples (m/s², gravity included): at least minShakes samples above threshold g within window, then quiet for cooldown.

Constructors

ShakeDetector({double threshold = 2.7, int minShakes = 2, Duration window = const Duration(milliseconds: 500), Duration cooldown = const Duration(milliseconds: 1500)})

Properties

cooldown → Duration
final
hashCode → int
The hash code for this object.
no setterinherited
minShakes → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
threshold → double
final
window → Duration
final

Methods

add(double x, double y, double z, DateTime at) → bool
True when this sample completes a shake.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited