Skip to main content

grpc_alice_interceptor 0.1.2 copy "grpc_alice_interceptor: ^0.1.2" to clipboard
grpc_alice_interceptor: ^0.1.2 copied to clipboard

gRPC client interceptor that records unary calls in the flutter_alice network inspector.

grpc_alice_interceptor #

GrpcAliceInterceptor records unary gRPC calls in flutter_alice for the network inspector UI.

Pair it with flutter_grpc_kit or any app that uses grpc ClientChannel interceptors.

Contributions welcome — see CONTRIBUTING.md.

Install #

dependencies:
  grpc_alice_interceptor: ^0.1.2
  flutter_alice: ^3.0.0
  grpc: ^5.1.0

For local development, use a path dependency to this repo.

Example #

The example/ app runs a local Greeter server and shows captured calls in Alice:

Example app

Alice inspector listing captured unary gRPC calls (metadata keys such as token are masked):

Alice inspector

cd example && dart run bin/server.dart   # terminal 1
cd example && flutter run                # terminal 2

Usage #

import 'package:flutter_alice/alice.dart';
import 'package:grpc_alice_interceptor/grpc_alice_interceptor.dart';
import 'package:flutter_grpc_kit/flutter_grpc_kit.dart';

final alice = Alice(navigatorKey: navigatorKey);
final factory = GrpcChannelFactory(gatewayUrl: 'https://grpc.example.com');

final interceptors = [
  GrpcAliceInterceptor(
    onCallRecorded: alice.addHttpCall,
    serverHost: factory.endpoint.host,
    secure: factory.endpoint.useTls,
  ),
];

Development #

flutter pub get
dart analyze
cd example && flutter test

Pull requests run the same checks via GitHub Actions. In branch protection, require CI / analyze (or analyze).

Article #

For a detailed walkthrough and usage examples, read Debugging gRPC requests in Flutter with Alice on my website or on Medium.

License #

MIT — see LICENSE.

1
likes
160
points
978
downloads

Documentation

API reference

Publisher

verified publishershemetau.eu

Weekly Downloads

gRPC client interceptor that records unary calls in the flutter_alice network inspector.

Repository (GitHub)
View/report issues
Contributing

Topics

#grpc #flutter #debugging #interceptor #alice

License

MIT (license)

Dependencies

flutter, flutter_alice, grpc, protobuf

More

Packages that depend on grpc_alice_interceptor