PusherClient class
This class is the main entry point for accessing Pusher.
By creating a new PusherClient instance a connection is
created automatically unless autoConnect
is set to false,
if auto connect is disabled this means you can call
connect()
at a later point.
Constructors
- PusherClient(String appKey, PusherOptions options, {bool enableLogging = true, bool autoConnect = true})
-
Creates a PusherClient -- returns the instance if it's already be called.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelEventChannelStream(
) → void -
This method will close the entire event channel stream
which is why it should only be used by PusherClient
inherited
-
connect(
) → Future - Initiates a connection attempt using the client's existing connection details
-
disconnect(
) → Future - Disconnects the client's connection
-
getSocketId(
) → String? - The id of the current connection
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConnectionError(
void callback(ConnectionError? error)) → void - Callback that indicates either:
-
onConnectionStateChange(
void callback(ConnectionStateChange? state)) → void - Callback that is fired whenever the connection state of the connection changes. The state typically changes during connection to Pusher and during disconnection and reconnection.
-
registerListener(
String classId, dynamic method(dynamic)) → void -
Add a listener to the event channel stream for pusher,
any class that extends
StreamHandler
should use this method.inherited -
subscribe(
String channelName) → Channel - Subscribes the client to a new channel
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
String channelName) → Future< void> - Unsubscribes from a channel using the name of the channel.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited