PhoenixSocket class
Constructors
-
PhoenixSocket(String endpoint, {dynamic socketOptions = PhoenixSocketOptions, dynamic connectionProvider = PhoenixConnectionProvider})
-
Creates an instance of PhoenixSocket
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 nonexistent 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