haptic_feedback
0.9.0+2, released 2 days ago by achim.io
A plugin for consistent haptic feedback patterns across iOS and Android.
What it does
Triggers haptic feedback and vibrations across platforms, aiming to emulate standard iOS haptic patterns on Android devices for a consistent user experience. It exposes APIs for checking hardware capability, preparing generators, and playing specific feedback types like success, warning, error, and light/medium/heavy impacts.
AI-written summary of version 0.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want consistent haptic feedback patterns across both iOS and Android platforms.
- Your app requires specific touch, selection, or notification haptic responses.
Skip it when
- Your app targets Flutter versions older than 3.47 or Android API versions below 24.
- You are running on web or desktop platforms where haptic feedback is unsupported.
Strengths
- Emulates iOS-style haptic patterns on Android devices for cross-platform consistency.
- Provides fine-grained options like Android haptic constants, vibration usage hints, and generator preparation.
Weaknesses
- Vibration feel and timing can vary across different Android hardware implementations.
- Returns false and is a no-op on unsupported platforms like web and desktop.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Automatically includes the VIBRATE permission in Android's merged manifest. Requires Flutter 3.47+ and Android API 24+.
import 'package:haptic_feedback/haptic_feedback.dart';
final canVibrate = await Haptics.canVibrate();
await Haptics.vibrate(HapticsType.success);Alternatives
Packages that do the same job and could replace haptic_feedback.
- flutter_vibrate
A Flutter plugin to trigger haptic feedback and vibrations on iOS and Android.
71Compare - gaimon
A Flutter plugin to support haptic feedback with custom patterns.
83Compare - pulsar_haptics
Rich haptic feedback and vibration patterns for Flutter on iOS and Android.
77Compare - vibration
A plugin for handling the Vibration API on iOS, Android, web, and OpenHarmony.
80Compare
Works with
Packages commonly used together with haptic_feedback: ones it builds on, ones built on it, and its own family.