SimpleWebSocket class
A class that facilitates WebSocket connections.
This class helps in establishing a WebSocket connection with a specified domain and provides methods to send messages and close the connection.
Constructors
-
SimpleWebSocket(String _domain, Map<
String, dynamic> _queryParams) - Constructs a SimpleWebSocket instance with the specified domain and query parameters.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onClose ↔ dynamic Function(int? code, String? reaso)?
-
Callback invoked when the WebSocket connection is closed.
getter/setter pair
- onMessage ↔ dynamic Function(dynamic msg)?
-
Callback invoked when a message is received on the WebSocket.
getter/setter pair
- onOpen ↔ dynamic Function()?
-
Callback invoked when the WebSocket connection is opened successfully.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → dynamic - Closes the WebSocket connection.
-
connect(
) → dynamic - Establishes a WebSocket connection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
dynamic data) → dynamic - Sends a message through the WebSocket connection.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited