floaty_chatheads 1.3.2 copy "floaty_chatheads: ^1.3.2" to clipboard
floaty_chatheads: ^1.3.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.3.2 #

๐Ÿ› Bug Fixes #

  • FloatyProxyStream now throws StateError on duplicate names. Creating a second stream with the same name without disposing the first previously caused silent overwrites and broken dispose semantics. A clear error message now guides the developer.

๐Ÿงช Tests #

  • Added duplicate-name guard tests for FloatyProxyStream.
  • Added 3 message-buffering tests for FloatyChannel (replay on handler registration, max-pending overflow, no buffering for previously-removed handlers) โ€” floaty_channel.dart is now at 100% line coverage.

1.3.1 #

โœจ Enhancements #

  • Added FloatyProxyStream<T>. A typed, reactive, unidirectional stream that pushes values from the main app to the overlay. The overlay subscribes once and receives automatic updates โ€” useful for GPS coordinates, sensor data, or any high-frequency state.

๐Ÿงช Tests #

  • Added 9 tests for FloatyProxyStream.

1.3.0 #

โœจ Enhancements #

  • Added FloatyChatheads.onClosed stream. A broadcast stream that emits the chathead ID when the overlay is closed by the native drag-to-close gesture or from the overlay itself. This lets the main app update its UI state without polling isActive().
  • Added NotificationConfig.description. Custom body text for the Android foreground-service notification. When set, the notification displays a separate title and body instead of the default "<title> is running" format.
  • Added FloatyChannel message buffering for reconnection reliability. System messages arriving before their handler is registered are now buffered (up to 200 per prefix) and replayed in order when the handler attaches. A _everRegistered set ensures messages for intentionally-removed handlers still flow to the raw stream.
  • New examples: Grouping, Move Tracking, Notification Actions, Resizable Panel, and Todo Survival examples added to the gallery app. The Todo Survival example demonstrates add / toggle / remove actions, optimistic local updates, proxy fallback, and full queue-flush reliability after app death.

๐Ÿ› Bug Fixes #

  • Fixed queued actions lost on reconnection. When the main app restarted, the overlay flushed its action queue before the Dart side had registered channel handlers, silently dropping every message. FloatyChannel now buffers system messages for not-yet-registered prefixes and replays them in order when registerHandler() is called. Bumped floaty_chatheads_android to ^1.0.5.
  • Fixed counter survival replaying all queued increments as a single value. Buffered actions are now stored as individual objects and replayed one-by-one with per-action log entries.
  • Fixed chathead close crash when GPS is streaming (Android). The overlay FlutterView was removed from its parent while the engine was still processing GPS data, causing an orphaned rendering window. Bumped floaty_chatheads_android to ^1.0.5.
  • Fixed foreground service persisting after chathead close (Android). The service teardown now completes before the overlay engine is destroyed. Bumped floaty_chatheads_android to ^1.0.5.
  • Fixed example UI state not updating on drag-to-close. All example screens now listen to FloatyChatheads.onClosed to update _chatheadActive when the chathead is dismissed via the native close gesture.

1.2.3 #

๐Ÿ› Bug Fixes #

  • Fixed overlay โ†’ main app communication broken on Android. The overlay FlutterEngine auto-registers all plugins, which overwrote the shared activeInstance in FloatyChatheadsPlugin with the overlay's instance. Messages sent from the overlay via shareData() looped back to the overlay instead of reaching the main app's onData stream. This affected all examples using raw FloatyOverlay.shareData / FloatyChatheads.onData communication (basic chathead, messenger, mini player, etc.). Bumped floaty_chatheads_android to ^1.0.4.

๐Ÿ“ฆ Metadata #

  • Added example/example.md for the pub.dev example tab.

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 SharedPreferences restore 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. Set debugMode: true in showChatHead() 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 with null, causing the panel to fall back to MATCH_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 a START_STICKY restart 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 to FloatyChatheads.onData, reduces incoming messages into typed state via a (T current, Object? raw) โ†’ T reducer, and rebuilds automatically. Eliminates manual StreamSubscription, setState, and dispose boilerplate.

  • Added FloatyOverlayBuilder<T> โ€” a zero-boilerplate builder for the overlay side that handles FloatyOverlay.setUp(), stream subscriptions, mounted guards, and FloatyOverlay.dispose() automatically. Supports onData reducer, optional onTapped reducer, and onInit callback. Turns overlay widgets into StatelessWidget declarations.

  • Added FloatyOverlayApp.runScoped() โ€” a variant of run() that wraps the child in FloatyScope, so FloatyScope.of(context) works everywhere inside the overlay without manual wiring.

  • Added builder parameter to FloatyControllerWidget โ€” accepts a Widget Function(BuildContext, FloatyController) callback with reactive re-rendering via ListenableBuilder. The child parameter is now optional when builder is 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 with IconSource.asset(), IconSource.network(), and IconSource.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 NotificationCounterOverlay using FloatyOverlayBuilder<int> โ€” now a StatelessWidget with zero lifecycle code.
  • Rewrote QuickActionOverlay using FloatyOverlayBuilder<bool> โ€” now a StatelessWidget with tap-to-toggle expand/collapse.
  • Rewrote QuickActionExample using FloatyDataBuilder<List<LogEntry>> โ€” incoming actions accumulate into a log via reducer, no manual subscription.

๐Ÿงช Tests #

  • Added 10 new tests for FloatyDataBuilder (5) and FloatyOverlayBuilder (5).

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_ios dependency 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 via set().
  • Provides a reactive stream of state changes and synchronous state access.
  • 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 with send().
  • Actions implement FloatyAction with type and toJson() 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.
  • FloatyProxyHost registers named service handlers in the main app.
  • FloatyProxyClient invokes them from the overlay and receives Future-based responses.
  • Enables clean separation of concerns between the overlay UI and app-side business logic.

๐Ÿ›ก๏ธ Overlay Survival After App Death (Android) #

  • The Android FloatyContentJobService now 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.
  • FloatyActionRouter now queues dispatched actions while the main app is disconnected and flushes them in order on reconnection. Configurable maxQueueSize and QueueOverflowStrategy.
  • FloatyProxyClient fails fast with FloatyProxyDisconnectedException when the main app is unavailable, with an optional fallback parameter to provide default values instead of throwing.
  • FloatyScopeData exposes isMainAppConnected for 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_WINDOW overlay with foreground service, Facebook Rebound spring physics, and full FlutterEngine content panels.
  • iOS โ€” UIWindow-based PiP overlay at .alert + 1 window 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

  • ChatHeadTheme model with badge colors, bubble border, shadow color, close tint, and overlay color palette.
  • Automatic palette delivery to overlay isolate on engine start.
  • FloatyOverlay.palette and onPaletteChanged stream for overlay-side consumption.

Size Presets

  • ContentSizePreset enum: compact, card, halfScreen, fullScreen.
  • Preset dimensions resolved before passing to the native layer.

Debug Inspector

  • debugMode flag on ChatHeadConfig.
  • 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") and ACTION_DISMISS ("Close chat bubble") custom actions.
  • AccessibilityLiveRegion.POLITE on close target for automatic announcements.

Snap & Animation

  • SnapEdge enum: left, right, nearest, none.
  • Configurable snap margin in dp.
  • persistPosition โ€” remembers last bubble position across sessions.
  • EntranceAnimation enum: 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.
  • FloatyPermissionGate widget for declarative permission handling.
  • 12 runnable example screens in the gallery app.

Architecture

  • floaty_chatheads โ€” app-facing API
  • floaty_chatheads_platform_interface โ€” abstract contract + models
  • floaty_chatheads_android โ€” Kotlin + Pigeon implementation
  • floaty_chatheads_ios โ€” Swift + Pigeon implementation
9
likes
160
points
404
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Floating chathead plugin for Android & iOS with draggable bubbles, expandable content panels, theming, snap-to-edge physics, and bidirectional app-overlay messaging.

Repository (GitHub)
View/report issues

Topics

#overlay #chathead #floating-window #widget #pip

License

MIT (license)

Dependencies

floaty_chatheads_android, floaty_chatheads_ios, floaty_chatheads_platform_interface, flutter, meta

More

Packages that depend on floaty_chatheads

Packages that implement floaty_chatheads