SocketIoManagement class
The SocketConnection class provides methods to manage WebSocket connections using the socket_io_client package. It offers functionalities to initialize a connection, check the connection status, and handle sending and receiving messages.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
{required String event, required dynamic callback(dynamic)}) → void - Listens for a socket.io event and executes the callback when the event occurs.
-
initConnection(
{required String socketURL, dynamic callback(dynamic data)?}) → void - Initializes the socket.io connection.
-
post(
{required String event, required dynamic data}) → void - Sends data to a socket.io event.
-
withAck(
{required String event, required dynamic data, Function? callback}) → void - Sends data to a socket.io event with an acknowledgment callback.