SseClient class

A client for bi-directional sse communication.

The client can send any JSON-encodable messages to the server by adding them to the sink and listen to messages from the server on the stream.

Inheritance

Constructors

SseClient(String serverUrl, {String? debugKey})
serverUrl is the URL under which the server is listening for incoming bi-directional SSE connections. debugKey is an optional key that can be used to identify the SSE connection.

Properties

hashCode int
The hash code for this object.
no setterinherited
onConnected Future<void>
no setter
onOpen Stream<Event>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sink StreamSink<String>
Add messages to this StreamSink to send them to the server.
no setteroverride
stream Stream<String>
Stream of messages sent from the server to this client.
no setteroverride

Methods

cast<S>() → StreamChannel<S>
Returns a copy of this with the generic type coerced to S.
inherited
changeSink(StreamSink<String?> change(StreamSink<String?>)) → StreamChannel<String?>
Returns a copy of this with sink replaced by change's return value.
inherited
changeStream(Stream<String?> change(Stream<String?>)) → StreamChannel<String?>
Returns a copy of this with stream replaced by change's return value.
inherited
close() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe(StreamChannel<String?> other) → void
Connects this to other, so that any values emitted by either are sent directly to the other.
inherited
toString() String
A string representation of this object.
inherited
transform<S>(StreamChannelTransformer<S, String?> transformer) → StreamChannel<S>
Transforms this using transformer.
inherited
transformSink(StreamSinkTransformer<String?, String?> transformer) → StreamChannel<String?>
Transforms only the sink component of this using transformer.
inherited
transformStream(StreamTransformer<String?, String?> transformer) → StreamChannel<String?>
Transforms only the stream component of this using transformer.
inherited

Operators

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