addInterceptor method

void addInterceptor(
  1. FutureOr<Map<String, String>?> fn(
    1. String,
    2. Map<String, String>
    )
)

Install a client interceptor: fn(path, metadata) runs before every call (in install order). It may mutate the metadata map in place (or return a replacement map) or throw a StatusException to reject the call before any frame is sent. Mirrors the server interceptor shape.

Implementation

void addInterceptor(
    FutureOr<Map<String, String>?> Function(String, Map<String, String>)
        fn) {
  _interceptors.add(fn);
}