advanced library

Advanced floaty_chatheads APIs for power users who need direct access to the underlying messaging primitives.

Most apps should import package:floaty_chatheads/floaty_chatheads.dart and use FloatyHostKit / FloatyOverlayKit, which bundle these primitives behind one disposable. Import this barrel only when you need to wire individual components yourself (e.g. exposing a router without state syncing, or running multiple isolated state channels).

Exports:

  • FloatyActionRouter: typed action dispatch
  • FloatyStateChannel: bidirectional state sync
  • FloatyProxyHost / FloatyProxyClient: RPC with response

FloatyProxyStream, FloatyMessenger, FloatyConnectionState, FloatyAction, ActionKey, and StreamKey stay in the main barrel because they are commonly needed even when using the Kits.

Classes

FloatyActionRouter
Typed action dispatch between the main app and the overlay: register handlers with on and an ActionKey, send actions with dispatch. On the overlay side, actions are queued while the main app is away.
FloatyProxyClient
Overlay-side proxy client that calls services on the main app, e.g. await FloatyProxyClient().call('location', 'getCurrentPosition').
FloatyProxyHost
Main-app-side proxy host that registers service providers.
FloatyStateChannel<S>
A typed, auto-syncing state channel between the main app and overlay.

Exceptions / Errors

FloatyProxyDisconnectedException
Thrown when a proxy call is attempted while the main app is disconnected.
FloatyProxyErrorException
Thrown when the host-side handler threw an exception.
FloatyProxyException
Base exception for proxy call failures.
FloatyProxyTimeoutException
Thrown when a proxy call exceeds its timeout.