WebsocketNotifier<T> class

Websocket Notifier

A notification dispatcher.

Constructors

WebsocketNotifier.new(String subscribeMethod, {required SubscriptionId subscriptionId, required bool autoUnsubscribes, required bool cancelOnError, required JsonRpcNotificationDecoder<T> decoder, required Duration? timeLimit, required void onTimeout()?})
Creates a notification dispatcher.

Properties

autoUnsubscribes bool
Whether the subscribeMethod automatically unsubscribes after sending a notification.
final
cancelOnError bool
Whether the dispatcher should be closed when an error is received.
final
decoder JsonRpcNotificationDecoder<T>
The notification's result decoder.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether the dispatcher has any listeners.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscribeMethod String
The JSON RPC subscribe method name.
final
subscriptionId SubscriptionId
The JSON RPC subscription id.
final

Methods

addListener({WebsocketOnDataHandler<T>? onData, WebsocketOnErrorHandler? onError, WebsocketOnDoneHandler? onDone}) WebsocketSubscription<T>
Adds a websocket subscription handler to the dispatcher.
close() → void
Notifies all listeners that the dispatcher has been closed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyData(Map<String, dynamic> data) → void
Notifies all listeners of data received by the websocket.
notifyError(Object error, [StackTrace? stackTrace]) → void
Notifies all listeners of an error received by the websocket.
removeListener(WebsocketSubscription<T> listener) bool
Removes a websocket subscription handler from the dispatcher.
toString() String
A string representation of this object.
inherited

Operators

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