WebSocketService class
WebSocket service for real-time sync
Constructors
- WebSocketService({required String url, String? authToken, Duration reconnectDelay = const Duration(seconds: 5), int maxReconnectAttempts = 5})
Properties
- authToken → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
Check if connected
no setter
- maxReconnectAttempts → int
-
final
-
onMessage
→ Stream<
WebSocketMessage> -
Stream of incoming messages
no setter
-
onStateChanged
→ Stream<
WebSocketState> -
Stream of connection state changes
no setter
- reconnectDelay → Duration
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → WebSocketState
-
Current connection state
no setter
- url → String
-
final
Methods
-
connect(
) → Future< void> - Connect to WebSocket server
-
disconnect(
) → Future< void> - Disconnect from WebSocket server
-
dispose(
) → Future< void> - Dispose resources
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
WebSocketMessage message) → void - Send message to server
-
subscribe(
String collection) → void - Subscribe to collection changes
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
String collection) → void - Unsubscribe from collection changes
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited