SocketEvent class
Represents events related to WebSocket connections.
The SocketEvent class contains optional callbacks for handling WebSocket events such as connection, disconnection, errors, and messages.
Constructors
-
SocketEvent({dynamic onConnect(SocketClient socket)?, dynamic onDisconnect(SocketClient socket)?, dynamic onError(SocketClient socket, Map<
String, dynamic> data)?, dynamic onMessage(SocketClient socket, Map<String, dynamic> data)?}) - Constructs a SocketEvent instance with optional event handlers.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onConnect ↔ dynamic Function(SocketClient socket)?
-
Callback function invoked when a client connects.
getter/setter pair
- onDisconnect ↔ dynamic Function(SocketClient socket)?
-
Callback function invoked when a client disconnects.
getter/setter pair
-
onError
↔ dynamic Function(SocketClient socket, Map<
String, dynamic> data)? -
Callback function invoked when an error occurs.
getter/setter pair
-
onMessage
↔ dynamic Function(SocketClient socket, Map<
String, dynamic> data)? -
Callback function invoked when a message is received.
getter/setter pair
- 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