haptic_kit 0.1.2
haptic_kit: ^0.1.2 copied to clipboard
Haptic feedback, vibration and animated UI widgets for Flutter — Android & iOS. Impact, notification, selection, predefined effects, custom waveforms, Core Haptics patterns plus 8 production-ready widgets.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.2 - 2026-05-13 #
Changed #
- Package renamed from
flutter_hapticstohaptic_kitbecause the former was rejected by pub.dev as too similar to the abandonedflutter_hapticpackage. The repository URL is unchanged. - All identifiers updated to match:
HapticKitPlugin(Android Kotlin- iOS Swift),
HapticKitChannel(Dart), Android packagedev.erykkruk.haptic_kit, method channeldev.erykkruk/haptic_kit.
- iOS Swift),
- Import path is now
package:haptic_kit/haptic_kit.dart. - Version 0.1.1 was tagged in git but never published — the public
history starts at
haptic_kit0.1.2.
0.1.1 - 2026-05-13 #
Changed #
- Package renamed from
flutter_vibration_animationtoflutter_hapticsto match the actual surface (Haptics,HapticPattern,HapticBounce, …) and to surface the library to users searching for haptic feedback rather than vibration animations. The GitHub repository keeps its original URL. - Method channel renamed from
dev.erykkruk/flutter_vibration_animationtodev.erykkruk/flutter_haptics. Android package and plugin class renamed accordingly (dev.erykkruk.flutter_haptics.FlutterHapticsPlugin). iOS podspec and plugin class renamed (FlutterHapticsPlugin). Haptics.prepare()now returnsFuture<bool>instead ofFuture<void>—truewhen the platform actually pre-warmed haptic generators (iOS),falsewhen the call is a no-op on the current platform (Android).HapticBouncenow validatespressedScale(must be in(0, 1)) andovershootScale(must be>= 1.0) at runtime, not only in debug. Bad values now throwArgumentErrorinstead of silently producing inverted scales in release builds.- Dropped the deprecated
library flutter_vibration_animation;directive from the barrel — modern Dart no longer requires it. - Barrel-level doc comment now lists all 8 animated widgets, making them
discoverable via IDE autocompletion on the
flutter_hapticsimport. - Pub.dev topics updated:
haptics,vibration,haptic-feedback,animation,widgets.
Added #
- Boundary-condition tests for
InvalidVibrationArgumentException: negative duration, amplitude belowkMinAmplitude, amplitude abovekMaxAmplitude, amplitude at the upper boundary, empty timings, negative waveform amplitude, out-of-rangerepeatindex. - Tests covering the new
Haptics.prepare()return value for both platform paths (iOS true / Android false). - Test covering the
invalid_argumentplatform error code mapping toInvalidVibrationArgumentException.
0.1.0 - 2026-04-30 #
Added #
- Initial release.
Haptics— impact (light/medium/heavy/soft/rigid), notification (success/warning/error), selection, prepare.Vibration— one-shot, custom waveforms with amplitude control, predefined OS effects, cancel.HapticPattern— fluent builder for Core Haptics events (intensity + sharpness, transient + continuous).VibrationPatterns— heartbeat, notification, alarm, tick, success, failure, charge-up.HapticCapabilities— runtime detection of vibrator hardware, amplitude control, Core Haptics, predefined effects.- Android implementation (Kotlin) with
Vibrator/VibratorManager(API 31+),VibrationEffect.createOneShot/createWaveform(API 26+),createPredefined(API 29+) and pre-API-26 fallbacks. - iOS implementation (Swift) with
UIImpactFeedbackGenerator,UINotificationFeedbackGenerator,UISelectionFeedbackGeneratorandCHHapticEnginefor custom patterns. AudioServices fallback for devices without Core Haptics. HapticToggle— animated switch with custom-painted thumb, spring-backeaseOutBackcurve and a selection tick on every flip.HapticSlider— wraps the standardSliderand fires a light tick at every detent crossing (configurable viadivisionsortickEvery), with a heavier tick at the min/max endpoints.HapticStepper— composes twoHapticBouncebuttons around a sliding number; light haptic on each step, heavy haptic when hittingmin/max.HapticShake— externally-triggered horizontal wiggle animation (6-segment decayingTweenSequence) with an error notification haptic. Triggered viaGlobalKey<HapticShakeState>().shake().SlideToConfirm— drag-to-confirm pill (Uber-style) with light ticks at 25/50/75% drag, heavy thump on completion, and spring-back with a tick on early release. State exposesreset()for re-arming.HapticRating— star row that cascade-fills with one selection tick per star when tapped, configurable cascade delay.- README "Building your own widget" section with the recurring pattern (one controller, gated thresholds, atomic cancel) and a table mapping each interaction moment to the right haptic.
HapticBouncewidget — drop-in tap wrapper with squash + recoil + elastic-settle bounce (3-segmentTweenSequencewith weights 1:2:3) synchronised with light/medium haptic impacts.PressAndHoldToConfirmwidget — long-press confirmation with a finger-tracking progress ring, 12-tick densifying haptic schedule, escalating intensity (selection → light → medium → heavy) and a final heavy impact on completion. SingleAnimationControllerdrives the ring, haptics and callback in lock-step. Single-pointer guard, cancel-on-early-release, andreset()for re-arming.- Showcase example app with five animated demos:
- Typewriter — auto-typing text with a
selectiontick per character. - Heartbeat — pulsing heart icon synced with
VibrationPatterns.heartbeat. - Loading ramp — progress bar 0→100% with light → medium → heavy haptic
impacts at 25/50/75% and a
successnotification at 100%. - Bouncy press — gradient circle wrapped in
HapticBounce. - Press & hold to unbox — gift-box card wrapped in
PressAndHoldToConfirmthat opens to a celebration on completion.
- Typewriter — auto-typing text with a