PublicChannel class
Public channels should be used for publicly accessible data as they do not require any form of authorization in order to be subscribed to.
You can subscribe and unsubscribe from channels at any time. There’s no need to wait for the Channels to finish connecting first.
See for more details: Public Channels docs.
- Inheritance
-
- Object
- Channel<
PublicChannelState> - PublicChannel
Constructors
- PublicChannel.internal({required ChannelsManagerStreamGetter publicStreamGetter, required ChannelsManagerConnectionDelegate connectionDelegate, required String name, required ChannelPublicEventEmitter publicEventEmitter})
Properties
- connectionDelegate → ChannelsManagerConnectionDelegate
-
A delegate that is passed by
ChannelsManager
. Exposes necessary API ofPusherChannelsClientLifeCycleController
.final - currentStatus → ChannelStatus?
-
Gives the current status of the state.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Name of this channel
final
- publicEventEmitter → ChannelPublicEventEmitter
-
Delegates a sink of the
ChannelsManager
's StreamController.final - publicStreamGetter → ChannelsManagerStreamGetter
-
A atream injection applied by an instance of
ChannelsManager
final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → PublicChannelState?
-
A current state of this channel
no setterinherited
Methods
-
bind(
String eventName) → Stream< ChannelReadEvent> -
Return a stream capturing events with respective
eventName
.inherited -
bindToAll(
) → Stream< ChannelReadEvent> -
Returns a stream with all the events captured
by this channel.
inherited
-
canHandleEvent(
ChannelReadEvent event) → bool -
inherited
-
getStateTest(
) → PublicChannelState? -
inherited
-
getStateWithNewStatus(
ChannelStatus status) → PublicChannelState -
override
-
getStateWithNewSubscriptionCount(
int? subscriptionCount) → PublicChannelState -
override
-
handleEvent(
ChannelReadEvent event) → void -
Handles events received from an instance of
ChannelsManager
inherited -
handleOtherExternalEvents(
ChannelReadEvent readEvent) → void -
Passes all other events to
ChannelsManager
's instances' sink i.e. - publicEventEmitterinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
) → void -
Sends the subscription event through the connectionDelegate.
override
-
subscribeIfNotUnsubscribed(
) → void -
Performs subscription if this channel was not unsubscibed
intentionally. Recommended to use while listening for
PusherChannelsClient.onConnectionEstablished
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
) → void -
Sends the unsubscription event through the connectionDelegate.
override
-
updateState(
PublicChannelState newState) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited