BroadcastInterceptor class abstract
The Broadcast Interceptor contract.
Provides hooks for inspecting and mutating messages at the driver level, mirroring the MagicNetworkInterceptor pattern. All methods have pass-through default implementations so subclasses only override what they need.
class LoggingBroadcastInterceptor extends BroadcastInterceptor {
@override
BroadcastEvent onReceive(BroadcastEvent event) {
print('Received ${event.event} on ${event.channel}');
return event;
}
}
Register interceptors via BroadcastDriver.addInterceptor.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
dynamic error) → dynamic - Called when the driver encounters an error.
-
onReceive(
BroadcastEvent event) → BroadcastEvent - Called when a BroadcastEvent is received from the server.
-
onSend(
Map< String, dynamic> message) → Map<String, dynamic> - Called before an outbound message is sent to the server.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited