reaction_overlay 0.1.0
reaction_overlay: ^0.1.0 copied to clipboard
A floating reaction bar (like iMessage/WhatsApp) for Flutter. Wrap any widget to add emoji reactions with animations, haptic feedback, dark mode, and smart positioning.
0.1.0 Simplified API & new features. #
Breaking changes #
- Removed
AppReactionOverlayManagerclass. UseReactionOverlay.show()orReactionTargetwidget instead. - Removed
itemKey/itemIdparameters. No moreGlobalKeymanagement needed — usesBuildContextdirectly. - Replaced
List<IconButton> buttonswithList<Reaction> reactions.
New features #
ReactionTargetwidget — Wrap any widget to add reactions on long press. Zero setup.Reactionmodel — SimpleReaction('👍', onTap: ...)instead of verboseIconButton(...).Reaction.custom()— Use any widget as a reaction icon.- Staggered animations — Each emoji appears with a progressive delay (iMessage-style).
- Selection animation — The chosen emoji bounces before closing.
- Haptic feedback — Vibration on long press and reaction selection (
enableHapticFeedback). - Dim background — Darkens the background when overlay is shown (
dimBackground,dimColor). - Smart positioning — Auto-detects whether to show above or below the target. Configurable via
OverlayPosition.auto / above / below. - Dark mode support — Automatically adapts background and shadow to the current theme.
- Tooltip labels —
Reaction('👍', label: 'Like')shows a tooltip on long press. onDismissedcallback — Notified when overlay closes without a selection.- Customizable shadow —
boxShadowparameter with theme-aware defaults. - Configurable button size —
buttonSizeandbuttonHeightparameters. onOverlayShowncallback — Notified when overlay is fully shown (after entrance animation).ReactionOverlayConfig— Centralized configuration object for simplified API usage.Reactionequality —==andhashCodebased on emoji for proper comparison.ReactionHistoryserialization —toJson()andfromJson()for persistence.- Fuzzy emoji search — Search by keywords, not just emoji characters.
- Staggered exit animation — Reverse staggered animation on dismiss.
Refactoring #
- Extracted
OverlayPositionCalculatorfor positioning logic (single responsibility). - Extracted
Particleclass for particle animation logic. - Reduced API surface by hiding internal data files (
emoji_data.dart,skin_tone_data.dart). - Updated exports to only expose public API types.
- Created
ReactionOverlayConfigto centralize configuration parameters. - Added
EmojiSearchutility for fuzzy emoji matching.
Testing #
- Added comprehensive unit tests for
Reaction,ReactionSet,ReactionHistory, andReactionOverlayThemeData. - Added widget tests for
ReactionBadge,ReactionBadgeBar, andReactionTarget. - Added enum tests for
OverlayPositionandTriggerMode. - Added tests for
Reactionequality,ReactionHistoryserialization,ReactionOverlayConfig, andEmojiSearch. - Test coverage: 65 tests passing.
0.0.4 WhatsApp-style interaction, UI polish, and performance. #
Added #
- Quick reactions on double tap with
ReactionTarget.quickReactionIndex. A long press still opens the complete reaction picker. - 48×48 minimum touch targets for reaction controls, improving usability and accessibility without forcing larger emoji artwork.
- Reduce-motion support: entrance, selection, and particle animations are skipped when the platform requests reduced motion.
- A dedicated widget test for the double-tap quick-reaction flow.
Improved #
- Reworked the emoji picker to use a lazy
CustomScrollViewandSliverGrid. Large emoji collections now build only visible cells. - Cached the picker emoji source list so searches do not repeatedly flatten all categories during rebuilds.
- Moved selection particles into an isolated
CustomPainterandRepaintBoundary, avoiding a full overlay rebuild on every animation frame. - Removed reaction-button outlines. Multiple selection now uses a subtle background tint instead of a border.
- Prevented duplicate reaction selections and duplicate dismiss actions while an animation is already in progress.
- Improved empty-category handling in the emoji picker.
Documentation #
- Rewrote the README with quick-start examples, centralized configuration,
WhatsApp-style quick reactions, theming, programmatic control, accessibility
guidance, and a migration guide from
0.0.3.
0.0.3 Overlay overflow fixes for minimal buttons. #
- If there are fewer than 6 buttons, the size adjusts automatically.
0.0.2 Overlay overflow fixes on small screens. #
- A fixed size is set for the overlay, initially displaying 6 buttons by default.
- If there are more than 6 buttons, an additional button is added to reveal the rest.
0.0.1 Basic functionality. #
Production ready, but i want to add more options
Custom Overlay Options.
- Send one or more widgets of type IconButton