vibration
3.2.1, released 3 months ago by an unverified publisher
A plugin for handling the Vibration API on iOS, Android, web, and OpenHarmony.
What it does
Provides methods to trigger device vibrations with custom durations, patterns, intensities, amplitudes, sharpness, and predefined presets. It also allows checking for vibration capabilities and amplitude control support.
AI-written summary of version 3.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to trigger tactile feedback or vibration patterns on mobile or web devices.
- You want to use predefined vibration presets for common alerts and notifications.
Skip it when
- You only need standard UI haptic feedback handled automatically by Flutter's HapticFeedback class.
Strengths
- Supports multiple platforms including Android, iOS, web, and OpenHarmony.
- Provides granular control over vibration duration, patterns, intensities, and amplitude.
- Includes a rich set of vibration presets.
Weaknesses
- Amplitude and custom vibration controls depend heavily on OS version and hardware capabilities.
- Requires manual native permission configuration for Android and OpenHarmony.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Requires adding the VIBRATE permission to AndroidManifest.xml and/or module.json5 for OpenHarmony.
if (await Vibration.hasVibrator()) {
Vibration.vibrate(duration: 1000);
}Alternatives
Packages that do the same job and could replace vibration.
- haptic_feedback
A plugin for consistent haptic feedback patterns across iOS and Android.
91Compare - haptic_kit
Haptic feedback, vibration and animated haptic widgets for Flutter on Android and iOS.
80Compare - pulsar_haptics
Rich haptic feedback and vibration patterns for Flutter on iOS and Android.
77Compare - flutter_presentation_display
A Flutter plugin designed to handle secondary presentation displays.
75Compare
Works with
Packages commonly used together with vibration: ones it builds on, ones built on it, and its own family.
- plugin_platform_interfacevibration depends on itReusable base class for platform interfaces of Flutter federated plugins.
- slider_buttonBuilt on vibrationA customizable slider button widget for activating or deactivating events.
- zego_uikit_prebuilt_callBuilt on vibrationFull-featured prebuilt UI kit for one-on-one and group voice and video calls with offline invitations.
- awesome_shake_widgetBuilt on vibrationA Flutter widget providing shake animations with optional haptic and vibration feedback.
- flutter_ume_plusBuilt on vibrationAn in-app debug kits platform for Flutter apps with built-in inspection plugins.