dart_phoenix_socket library

A lightweight Phoenix Channel V2 client for Dart.

Classes

PhoenixChannel
Manages a Phoenix Channel's lifecycle: join, push, leave.
PhoenixMessage
Represents a Phoenix Channel V2 message.
PhoenixPresence
Manages Phoenix Presence state for a channel.
PhoenixSocket
Manages a Phoenix WebSocket connection.

Enums

PhoenixChannelState
The lifecycle state of a PhoenixChannel.
PhoenixSocketState
The connection state of a PhoenixSocket.

Typedefs

OnJoin = void Function(String key, PresenceEntry? current, PresenceEntry newPres)
Callback fired when a key joins or gets new metas.
OnLeave = void Function(String key, PresenceEntry current, PresenceEntry leftPres)
Callback fired when a key loses metas or leaves entirely.
PresenceEntry = ({List<Map<String, dynamic>> metas})
A single presence entry for one key (user/device).
PresenceState = Map<String, PresenceEntry>
The full presence state: a map from key (e.g. user ID) to PresenceEntry.

Exceptions / Errors

PhoenixException
Exception thrown by PhoenixSocket operations.