Skip to content
pubscout

shake_gesture

2.2.1, released 4 weeks ago by helloprimary.care

Detect shake gestures in Flutter apps on Android and iOS.

WASM-ready
$ flutter pub add shake_gesture
Source repository

What it does

Provides a Flutter widget and imperative API to detect shake gestures on Android and iOS devices. It allows executing callbacks when a shake gesture is performed, and works on simulators as well.

AI-written summary of version 2.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to trigger a feature or debug menu via a shake gesture on mobile devices.
  • You need a drop-in widget or imperative callback for shake detection.

Skip it when

  • You need custom shake sensitivity specifically on iOS devices.
  • You are building for desktop or web platforms.

Strengths

  • Supports both widget and imperative usage.
  • Works on iOS and Android simulators.
  • Includes test helpers for testing shake detection.

Weaknesses

  • Shake gestures cannot be customized on iOS.
  • Limited platform support (only Android and iOS).

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
3

Optional customization can be done via AndroidManifest.xml for Android shake force and count.

ShakeGesture(
  onShake: () {
    print('Shake!');
  },
  child: const Text('Shake me'),
)

Alternatives

Packages that do the same job and could replace shake_gesture.