PhoenixPresence class Null safety

A Phoenix Presence client to interact with a backend Phoenix Channel implementing the Presence module. https://hexdocs.pm/phoenix/presence.html

Constructors

PhoenixPresence({required PhoenixChannel channel, Map<String, String> eventNames = const {'state' : 'presence_state', 'diff' : 'presence_diff'}})
Attaches a Phoenix Presence client to listen to new presence messages on an existing channel. [...]

Properties

channel PhoenixChannel
A Phoenix Channel which implements the Phoenix Presence module on the backend.
final
diffEventName String
Gets the name of the 'diff' event to listen to if different than the default 'presence_diff'.
read-only
eventNames Map<String, String>
A custom map of event names to listen to on the channel. Defaults to the standard Phoenix Presence events names: [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
inPendingSyncState bool
Checks whether the presence channel is currently syncing with the server.
read-only
onJoin JoinHandler
Optional callback to react to changes in the client's local presences when connecting/reconnecting with the server.
read / write
onLeave LeaveHandler
Optional callback to react to changes in the client's local presences when disconnecting from the server.
read / write
onSync ↔ dynamic Function()
Optional callback triggered after a Presence message/event has been processed.
read / write
pendingDiffs List<Map<String, Map<String, Presence>>>
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state Map<String, Presence>
All presences advertised by the Phoenix backend in real time.
read / write
stateEventName String
Gets the name of the 'state' event to listen to if different than the default 'presence_state'.
read-only

Methods

dispose() → void
Stops listening to new messages on channel.
list(Map<String, Presence> presences, [dynamic chooser(String, Presence)?]) List
Returns the array of presences, with selected metadata formatted according to the chooser function. See Example for better understanding and implementation details.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited