Channel<T extends ChannelState> class abstract

Receives and handles respective events delegated by ChannelsManager.

Each application can have one channel or many, and each client can choose which channels it subscribes to. Channels provide:

  • A way of filtering data For example, in a chat application there may be a channel for people who want to discuss ‘dogs’
  • A way of controlling access to different streams of information. For example, a project management application would want to authorize people to get updates about ‘secret-projectX’

Supported channels:

See for more details: Channels docs

Available Extensions




connectionDelegate → ChannelsManagerConnectionDelegate
A delegate that is passed by ChannelsManager. Exposes necessary API of PusherChannelsClientLifeCycleController.
no setter
currentStatus ChannelStatus?
Gives the current status of the state.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
Name of this channel
no setter
publicEventEmitter → ChannelPublicEventEmitter
Delegates a sink of the ChannelsManager's StreamController.
no setter
publicStreamGetter ChannelsManagerStreamGetter
A atream injection applied by an instance of ChannelsManager
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → T?
A current state of this channel
no setter


bind(String eventName) Stream<ChannelReadEvent>
Return a stream capturing events with respective eventName.
bindToAll() Stream<ChannelReadEvent>
Returns a stream with all the events captured by this channel.
canHandleEvent(ChannelReadEvent event) bool
getStateTest() → T?
getStateWithNewStatus(ChannelStatus status) → T
getStateWithNewSubscriptionCount(int? subscriptionCount) → T
handleEvent(ChannelReadEvent event) → void
Handles events received from an instance of ChannelsManager
handleOtherExternalEvents(ChannelReadEvent readEvent) → void
Passes all other events to ChannelsManager's instances' sink i.e. - publicEventEmitter
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
subscribe() → void
Presets this current state with new status - ChannelStatus.pendingSubscription
subscribeIfNotUnsubscribed() → void
Performs subscription if this channel was not unsubscibed intentionally. Recommended to use while listening for PusherChannelsClient.onConnectionEstablished
toString() String
A string representation of this object.
unsubscribe() → void
Presets this current state with new status - ChannelStatus.unsubscribed
updateState(T newState) → void


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