floaty_chatheads 1.2.2
floaty_chatheads: ^1.2.2 copied to clipboard
Floating chathead plugin for Android & iOS with draggable bubbles, expandable content panels, theming, snap-to-edge physics, and bidirectional app-overlay messaging.
Changelog #
1.2.2 #
โจ Enhancements #
- Upgraded Pigeon to 26.2.3. Regenerated overlay Pigeon bindings across all platform packages. No API surface changes.
- Updated Android demo GIF in the media folder.
๐ Bug Fixes #
- Fixed survival overlay counter adding +1 on every reconnection. The overlay's manual re-dispatch logic fired even though the framework's automatic queue flush already delivered the queued actions, causing every increment to be applied twice. Removed the redundant re-dispatch โ the queue flush is reliable on its own.
- Fixed counter race condition on app restart. Queued actions
arriving via auto-flush before
SharedPreferencesrestore could increment from zero instead of the persisted value. Increment actions are now buffered until the counter is restored.
1.2.1 #
โจ Enhancements #
- Debug logs are now optional and silent by default (Android). All
native logcat output from the plugin is gated behind
debugMode. SetdebugMode: trueinshowChatHead()to enable verbose logging during development; production builds produce zero log noise.
๐ Bug Fixes #
- Fixed content panel rendering fullscreen on subsequent launches
(Android). When the foreground service had not started yet,
showChatHead()only saved the entry point to SharedPreferences, omitting content dimensions. On service startup,restoreConfig()then overwrote the in-memory values withnull, causing the panel to fall back toMATCH_PARENT. The plugin now persists the full config and the service guards against overwriting values that the plugin already set. - Fixed content panel dimensions leaking between chathead sessions on Android. Switching from a larger overlay (e.g. 300x400) to a smaller one (e.g. 220x220) no longer inherits the previous session's size.
- Fixed missing touch interaction on the content panel after switching
between chathead sessions. The plugin now explicitly recreates the
overlay window with fresh dimensions instead of relying on
onStartCommand(), which could skip recreation when a stale window from aSTART_STICKYrestart was still present. - Fixed iOS content size not resetting between sessions โ dimensions now default to 300x400 before applying the new config.
1.2.0 #
๐งฉ Higher-Level Convenience Widgets #
-
Added
FloatyDataBuilder<T>โ a reactive builder for the main app side that subscribes toFloatyChatheads.onData, reduces incoming messages into typed state via a(T current, Object? raw) โ Treducer, and rebuilds automatically. Eliminates manualStreamSubscription,setState, anddisposeboilerplate. -
Added
FloatyOverlayBuilder<T>โ a zero-boilerplate builder for the overlay side that handlesFloatyOverlay.setUp(), stream subscriptions,mountedguards, andFloatyOverlay.dispose()automatically. SupportsonDatareducer, optionalonTappedreducer, andonInitcallback. Turns overlay widgets intoStatelessWidgetdeclarations. -
Added
FloatyOverlayApp.runScoped()โ a variant ofrun()that wraps the child inFloatyScope, soFloatyScope.of(context)works everywhere inside the overlay without manual wiring. -
Added
builderparameter toFloatyControllerWidgetโ accepts aWidget Function(BuildContext, FloatyController)callback with reactive re-rendering viaListenableBuilder. Thechildparameter is now optional whenbuilderis provided.
๐ฆ Grouped Configuration Objects #
- Added
ChatHeadAssetsโ groups chathead icon, close icon, and close background into a single object. Old flat parameters are deprecated. - Added
NotificationConfigโ groups notification title, icon, and visibility into a single object. Old flat parameters are deprecated. - Added
SnapConfigโ groups snap edge, margin, and position persistence into a single object. Old flat parameters are deprecated. - Added
IconSourceโ polymorphic icon source withIconSource.asset(),IconSource.network(), andIconSource.bytes()constructors for flexible icon loading from assets, URLs, or raw byte data.
โจ Simplified Examples #
- Simplified all 14 overlay entry points from verbose 6-line blocks to
single-line
FloatyOverlayApp.run()calls (84 โ 14 lines total). - Rewrote
NotificationCounterOverlayusingFloatyOverlayBuilder<int>โ now aStatelessWidgetwith zero lifecycle code. - Rewrote
QuickActionOverlayusingFloatyOverlayBuilder<bool>โ now aStatelessWidgetwith tap-to-toggle expand/collapse. - Rewrote
QuickActionExampleusingFloatyDataBuilder<List<LogEntry>>โ incoming actions accumulate into a log via reducer, no manual subscription.
๐งช Tests #
- Added 10 new tests for
FloatyDataBuilder(5) andFloatyOverlayBuilder(5), bringing the total to 233 tests across all packages.
1.1.0 #
๐ iOS Feature Parity #
- iOS now supports entrance animations, snap-to-edge, position persistence, badge counter, theming, expand/collapse, drag events, and VoiceOver accessibility.
- Removed "Android only" notes from platform interface docs.
- Bumped
floaty_chatheads_iosdependency to^1.1.0.
๐ Shared State Channel #
- Added
FloatyStateChannel<T>โ a generic, type-safe channel for synchronizing arbitrary state between the main app and the overlay. - Supports partial updates via
update()and full replacements viaset(). - Provides a reactive
streamof state changes and synchronousstateaccess. - Works with any serializable Dart model, not limited to a specific domain.
๐ฐ๏ธ Bidirectional Action Routing #
- Added
FloatyActionRouterโ a typed, extensible action bus for dispatching structured commands between app and overlay. - Register strongly-typed handlers with
on<A>()and send actions withsend(). - Actions implement
FloatyActionwithtypeandtoJson()for automatic serialization over the platform channel.
๐ช Overlay Proxy #
- Added
FloatyProxyโ lets the overlay call app-side services (e.g. APIs, databases, repositories) without direct dependencies. FloatyProxyHostregisters named service handlers in the main app.FloatyProxyClientinvokes them from the overlay and receivesFuture-based responses.- Enables clean separation of concerns between the overlay UI and app-side business logic.
๐ก๏ธ Overlay Survival After App Death (Android) #
- The Android
FloatyContentJobServicenow owns the Flutter engine lifecycle. The overlay survives when the main app is killed and automatically restores from persisted config on service restart. - Added
FloatyConnectionStateโ overlay-side utility that tracks whether the main app is connected, with a reactive stream and synchronous getter. FloatyActionRouternow queues dispatched actions while the main app is disconnected and flushes them in order on reconnection. ConfigurablemaxQueueSizeandQueueOverflowStrategy.FloatyProxyClientfails fast withFloatyProxyDisconnectedExceptionwhen the main app is unavailable, with an optionalfallbackparameter to provide default values instead of throwing.FloatyScopeDataexposesisMainAppConnectedfor reactive overlay UI updates.- The plugin automatically reconnects to an existing overlay when the main app restarts (hot-restart or cold launch).
1.0.1 #
- Added Android and iOS demo GIFs to README.
- Fixed foreground notification on service reuse.
- Documentation and metadata updates.
1.0.0 #
๐ Initial Release โ Complete Rewrite #
A ground-up rewrite of the floating chathead plugin, inspired by flutter_overlay_window.
Platform Support
- Android โ
SYSTEM_ALERT_WINDOWoverlay with foreground service, Facebook Rebound spring physics, and fullFlutterEnginecontent panels. - iOS โ
UIWindow-based PiP overlay at.alert + 1window level. No special permissions required. Supports iOS 13+.
Core Features
- Floating chathead bubbles rendered as system-level overlays.
- Expand / collapse Flutter widget content panels.
- Bidirectional data messaging between the main app and overlay isolate
via
BasicMessageChannel. - Drag-and-drop with spring-animated snap-to-edge.
- Close target with magnetic snap and animated reveal.
- Badge counter on chathead bubbles.
- Multi-bubble support โ add / remove individual chatheads by ID.
Theming API
ChatHeadThememodel with badge colors, bubble border, shadow color, close tint, and overlay color palette.- Automatic palette delivery to overlay isolate on engine start.
FloatyOverlay.paletteandonPaletteChangedstream for overlay-side consumption.
Size Presets
ContentSizePresetenum:compact,card,halfScreen,fullScreen.- Preset dimensions resolved before passing to the native layer.
Debug Inspector
debugModeflag onChatHeadConfig.DebugOverlayView(Android) with bounds rectangles, position labels, spring velocity HUD, and FPS counter.- Pigeon message log (circular buffer, 50 entries).
FloatyOverlay.getDebugInfo()for Dart-side debug panels.
Accessibility (Android)
- Full TalkBack support with content descriptions, state announcements, and accessibility actions on all interactive views.
- Focus management: content panel receives focus on expand, bubble receives focus on collapse.
ACTION_CLICK("Expand / Collapse chat") andACTION_DISMISS("Close chat bubble") custom actions.AccessibilityLiveRegion.POLITEon close target for automatic announcements.
Snap & Animation
SnapEdgeenum:left,right,nearest,none.- Configurable snap margin in dp.
persistPositionโ remembers last bubble position across sessions.EntranceAnimationenum:none,slideInFromLeft,slideInFromRight,fadeIn.
Developer Experience
- Federated plugin architecture (main โ platform_interface โ android / ios).
- Pigeon-generated type-safe Dart โ Kotlin / Swift communication.
- VGV-style
{@template}/{@macro}documentation across all packages. FloatyPermissionGatewidget for declarative permission handling.- 12 runnable example screens in the gallery app.
Architecture
floaty_chatheadsโ app-facing APIfloaty_chatheads_platform_interfaceโ abstract contract + modelsfloaty_chatheads_androidโ Kotlin + Pigeon implementationfloaty_chatheads_iosโ Swift + Pigeon implementation