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
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