Notifier class

A notifier emits events intended to be used for implementing client-side notifications.

A notifier will emit an updated event whenever there is a new message posted in any of the rooms of the connected user (of course, excluding messages authored by the latter). In case the websocket connection temporarily drops, upon reconnecting the notifier will emit events for the messages missed while the client was disconnected.

List of events

  • error → Fired when there is a problem establishing connection to the server. The attached event listeners are called with an ErrorEvent instance.
  • ready → Fired at most once, when the connection to the server is first established. The attached event listeners are called with a NotifierReadyEvent instance.
  • updated → Fired when there is a new message posted in any of the rooms that the connected user has access to. The attached event listeners are called with a NotifierUpdatedEvent instance.

Constructors

Notifier(Connector _connector, int _userId)
Do not create instances directly — use Kabelwerk.openNotifier instead.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect() Future<PushResponse>
Establishes connection to the server.
disconnect() → void
Closes the connection to the server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off([String? event, String? reference]) → void
Removes one or more previously attached event listeners.
on(String event, Function function) String
Attaches an event listener.
once(String event, Function function) String
Attaches a one-time event listener.
toString() String
A string representation of this object.
inherited

Operators

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