FakeBroadcastDriver class

An in-memory BroadcastDriver that records all operations for assertions.

Accessed via FakeBroadcastManager.driver in tests.

Implemented types

Constructors

FakeBroadcastDriver()

Properties

addedInterceptors → List<BroadcastInterceptor>
The list of interceptors that have been added.
no setter
connectionState → Stream<BroadcastConnectionState>
A broadcast stream of BroadcastConnectionState transitions.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
isConnected → bool
Whether the driver is currently connected.
no setteroverride
listeners → Map<String, List<String>>
Registered event names per channel, for low-level inspection.
no setter
onReconnect → Stream<void>
A stream that emits once each time the driver successfully reconnects.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
socketId → String?
The socket identifier assigned by the server, or null when not connected.
no setteroverride
subscribedChannels → List<String>
The list of channel names currently recorded as subscribed.
no setter

Methods

addInterceptor(BroadcastInterceptor interceptor) → void
Registers an interceptor to be applied to all outbound and inbound messages processed by this driver.
override
channel(String name) → BroadcastChannel
Returns a public BroadcastChannel for name.
override
connect() → Future<void>
Establishes the connection to the broadcast server.
override
disconnect() → Future<void>
Closes the connection and releases all resources.
override
join(String name) → BroadcastPresenceChannel
Joins a presence channel for name and returns it.
override
leave(String name) → void
Unsubscribes from the channel identified by name.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
private(String name) → BroadcastChannel
Returns a private BroadcastChannel for name.
override
setSubscribed(String channel, bool subscribed) → void
Sets what BroadcastChannel.isSubscribed answers for channel, the fully-qualified name (private-orders, not orders), and emits on its BroadcastChannel.onSubscriptionChanged when the value changes.
toString() → String
A string representation of this object.
inherited

Operators

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