BroadcastPresenceChannel class abstract

The Broadcast Presence Channel contract.

Extends BroadcastChannel with membership awareness. Presence channels expose the list of currently-connected members and emit streams when members join or leave, enabling features such as online indicators and typing notifications.

final channel = Echo.join('room.1');
channel.onJoin.listen((member) => print('${member['user_id']} joined'));
channel.onLeave.listen((member) => print('${member['user_id']} left'));
Inheritance
Implementers

Constructors

BroadcastPresenceChannel()

Properties

events → Stream<BroadcastEvent>
A broadcast stream of every BroadcastEvent received on this channel.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isSubscribed → bool
Whether the server has confirmed this channel on the current connection.
no setterinherited
members → List<Map<String, dynamic>>
The current list of members connected to this presence channel.
no setter
name → String
The fully-qualified channel name as sent to the server (e.g. 'orders').
no setterinherited
onJoin → Stream<Map<String, dynamic>>
A stream that emits a member payload each time a new member joins.
no setter
onLeave → Stream<Map<String, dynamic>>
A stream that emits a member payload each time a member leaves.
no setter
onSubscriptionChanged → Stream<bool>
Emits the new isSubscribed value each time it changes: true on subscription_succeeded, false on a drop or a leave.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

listen(String event, void callback(BroadcastEvent)) → BroadcastChannel
Registers a callback to be invoked whenever event is received.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stopListening(String event) → void
Removes the listener previously registered for event.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited