Skip to content
pubscout

connectrpc

2.0.1, released 4 weeks ago by connectrpc.com

Implementation of the Connect protocol for Dart, supporting Protobuf, gRPC, and gRPC-Web.

$ flutter pub add connectrpc
Source repository

What it does

Connect-Dart provides type-safe and idiomatic Dart clients to communicate with application servers using Protocol Buffers. It works with the Connect, gRPC, and gRPC-Web protocols, generating clean client code from your Protobuf schemas.

AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using Protocol Buffers for your backend API communication.
  • You need to support Connect, gRPC, or gRPC-Web protocols in your Dart application.
  • You want type-safe, generated clients with support for unary and streaming RPCs.

Skip it when

  • Your backend relies solely on REST/JSON APIs without gRPC or Connect support.
  • You prefer writing manual HTTP requests over code generation.

Strengths

  • Type-safe and idiomatic clients generated from Protobuf schemas.
  • Supports Connect, gRPC, and gRPC-Web protocols.
  • Handles both unary calls and bi-directional or server streaming out of the box.

Weaknesses

  • Requires using Protocol Buffers and code generation setup.
  • Depends on the V6 Protobuf runtime and requires Dart 3.7.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
4

Requires defining Protobuf schemas and generating Dart client code, as well as importing the required runtime dependencies.

void main() async {
    late ElizaServiceClient elizaClient;
    final response = await elizaClient.say(SayRequest(sentence: "Hey!"))
    print(response.message);
}

Alternatives

Packages that do the same job and could replace connectrpc.

Works with

Packages commonly used together with connectrpc: ones it builds on, ones built on it, and its own family.