RealtimeClient class

Client for realtime WebSocket operations

Constructors

RealtimeClient({required String wsUrl, required TokenStorage tokenStorage})
Creates a new RealtimeClient instance

Properties

connectionStream Stream<bool>
Stream of connection status
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether currently connected
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenStorage TokenStorage
Token storage
final
wsUrl String
WebSocket URL
final

Methods

authenticate(String token) Future<void>
Authenticates with the server
broadcast(String channel, Map<String, dynamic> data) → void
Broadcasts a message to a channel
connect() Future<void>
Connects to the WebSocket server
disconnect() Future<void>
Disconnects from the WebSocket server
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping() → void
Sends a ping to keep connection alive
subscribe(String collection, void callback(RealtimeEvent)) → void
Subscribes to a collection's changes
toString() String
A string representation of this object.
inherited
unsubscribe(String collection, [void callback(RealtimeEvent)?]) → void
Unsubscribes from a collection

Operators

operator ==(Object other) bool
The equality operator.
inherited