PhoenixSocket class Null safety

Constructors

PhoenixSocket(String endpoint, {dynamic socketOptions = PhoenixSocketOptions, dynamic connectionProvider = PhoenixConnectionProvider})
Creates an instance of PhoenixSocket [...]

Properties

channels List<PhoenixChannel>
read / write
conn → PhoenixConnection?
read-only
connectionState int
read-only
endpoint Uri?
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isConnected bool
read-only
reconnectAfterMs List<int>
read / write
ref int
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sendBufferLength int
read-only
timeout int
read / write

Methods

channel(String topic, [Map params = const {}]) PhoenixChannel
topic is the name of the channel you wish to join params are any options parameters you wish to send
connect() → dynamic
Attempts to make a WebSocket connection to your backend [...]
disconnect({int code = PhoenixConnection.CLOSE_NORMAL}) → dynamic
Terminates the socket connection with an optional code
makeRef() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onClose(dynamic callback(dynamic)) → dynamic
Add a callback to be executed when the connection is closed
onError(dynamic callback(dynamic)) → dynamic
Add a callback to be executed if an error occurs
onMessage(dynamic callback(PhoenixMessage)) → dynamic
Add a callback for when a message is received
onOpen(dynamic callback()) → dynamic
Add a callback to be executed when the connection is successfully made
push(PhoenixMessage msg) → void
Pushes a message to the server
reconnect() → dynamic
In the event of a network dropout or other error, attempt to reconnect
remove(PhoenixChannel channelToRemove) → dynamic
stopHeartbeat() → void
toString() String
A string representation of this object. [...]
inherited

Operators

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