EventFluxInterceptor class abstract

Abstract class for intercepting EventFlux request/response lifecycle.

Subclass this to hook into requests before sending, responses after receiving, and errors when they occur. All methods have pass-through defaults so you only override what you need.

Example:

class AuthInterceptor extends EventFluxInterceptor {
  @override
  Future<BaseRequest> onRequest(BaseRequest request) async {
    request.headers['Authorization'] = 'Bearer $token';
    return request;
  }
}

Constructors

EventFluxInterceptor()

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(EventFluxException exception) Future<EventFluxException?>
Called when an error occurs.
onRequest(BaseRequest request) Future<BaseRequest>
Called before a request is sent.
onResponse(StreamedResponse response) Future<StreamedResponse>
Called after a response is received, before status-code branching.
toString() String
A string representation of this object.
inherited

Operators

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