FakeSseTransport class final
An SseTransport that hands the test direct control of each connection.
- Implemented types
Constructors
- FakeSseTransport({bool handlesReconnect = false})
- Creates a fake transport.
Properties
- closed ↔ bool
-
Whether close has been called.
getter/setter pair
- connectionCount → int
-
How many connections have been opened.
no setter
-
current
→ StreamController<
SseEvent> -
The most recently opened connection.
no setter
- failNextWith ↔ Object?
-
Makes the next subscribe call fail with this error.
getter/setter pair
- handlesReconnect → bool
-
Whether this transport re-establishes dropped connections itself.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
requestedLastEventIds
→ List<
String?> -
lastEventIdvalues passed to subscribe, oldest first.final -
requestedUrls
→ List<
Uri> -
URLs passed to subscribe, oldest first.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Releases any resources this transport owns.
override
-
emit(
SseEvent event) → void -
Delivers
eventon the current connection. -
emitMessage(
String data, {String? id}) → void - Delivers a bridge envelope on the current connection.
-
endConnection(
) → void - Ends the current connection as the server closing it.
-
failConnection(
Object error) → void - Fails the current connection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
Uri url, {String? lastEventId}) → Future< Stream< SseEvent> > -
Subscribes to
url.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited