RelayApi class abstract

An abstract class that defines the API for interacting with a relay service.

Constructors

RelayApi({required String relayUrl})
Creates a new instance of RelayApi with the specified relayUrl.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
relayUrl String
The URL of the relay to connect to.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the WebSocket connection to the relay.
connect() Future<Stream<Message>>
Connects to the relay server and returns a stream of Message objects.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(dynamic callback(RelayEvent)) → void
Sets a callback function to be called when events occur on the relay. The callback function should take a single argument of type RelayEvent.
publish(Event event) → void
Publishes an event to the relay.
sub(List<Filter> filters) → void
Subscribes to a set of filters on the relay. Only events that match the filters will be received. The filters argument is a list of Filter objects.
toString() String
A string representation of this object.
inherited

Operators

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