FlutterWSocketProvider class
A singleton provider for managing native WebSocket connections.
This class provides direct WebSocket communication (RFC 6455) with automatic reconnection using exponential backoff, multi-endpoint support, and channel management.
Usage
final wSocketDataProvider = WSocketDataProvider();
final wSocketProvider = FlutterWSocketProvider(
wSocketDataProvider: wSocketDataProvider,
);
await wSocketProvider.inicializaEscucha(
idChannel: 'channel-id',
token: 'auth-token',
endpointSocket: 'wss://websocket.example.com',
);
See also:
- WSocketDataProvider for reactive state management
- FlutterSocketProvider for Socket.IO implementation
Constructors
- FlutterWSocketProvider({required WSocketDataProvider wSocketDataProvider, bool debugMode = false})
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
lstIdChannel
→ Map<
String, List< String> > -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- wSocketDataProvider → WSocketDataProvider
-
final
Methods
-
disconnect(
{String? endpointSocket}) → void -
inicializaEscucha(
{required String idChannel, required String token, required String endpointSocket}) → Future< void> -
leaveRoom(
{required String endpointSocket, String? idChannel}) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMensajeSocketService(
{required String endpointSocket, required String idChannel, required Map< String, dynamic> payload}) → Future<Map< String, dynamic> > -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited