FreeFireSocket<T> class
A wrapper class for managing WebSocket communication through FreeFireSocketService.
The FreeFireSocket class simplifies WebSocket handling by encapsulating FreeFireSocketService initialization, connection, and message sending. It provides access to the WebSocket stream and methods for closing connections and disposing resources.
Constructors
- FreeFireSocket()
- Creates a FreeFireSocket instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
service
↔ FreeFireSocketService<
T> -
getter/setter pair
-
stream
→ Stream<
T> -
Stream of data received from the WebSocket.
no setter
Methods
-
close(
) → void - Closes the WebSocket connection.
-
dispose(
) → void - Disposes of resources used by the WebSocket service.
-
init(
SocketConfig config) → Future< void> -
Initializes the WebSocket connection with the provided
config. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
String message, {String persistKey = ''}) → void -
Sends a
messageto the WebSocket server. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited