grpc
5.2.0, released 5 weeks ago by dart.dev
Dart implementation of gRPC, a high performance universal RPC framework.
Rock solid
What it does
Provides client and server implementations for gRPC in Dart and Flutter. It allows communication using HTTP/2 and Protocol Buffers, with support for gRPC-Web.
AI-written summary of version 5.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need high-performance communication between microservices or client and server using gRPC.
- Your backend services are already using gRPC and Protocol Buffers.
Skip it when
- Your backend is built around a standard REST/JSON API.
- You want a lightweight HTTP client without the overhead of Protocol Buffers and gRPC setup.
Strengths
- High performance and efficient binary serialization via Protocol Buffers.
- Supports both Dart native and Flutter across multiple platforms.
- Includes support for gRPC-Web and Unix Domain Sockets.
Weaknesses
- Requires managing Protocol Buffer definitions and code generation.
- Steeper learning curve compared to standard REST clients.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 10
Requires setting up Protocol Buffer definitions and compilation tools to generate Dart stubs.
import 'package:grpc/grpc.dart';
// See https://grpc.io/docs/languages/dart/quickstart for complete setupAlternatives
Packages that do the same job and could replace grpc.
Works with
Packages commonly used together with grpc: ones it builds on, ones built on it, and its own family.
- cryptogrpc depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- webgrpc depends on itLightweight bindings for browser APIs via JS interop
- clockgrpc depends on itA fakeable wrapper for dart:core clock APIs.
- asyncgrpc depends on itUtility classes and helpers that extend Dart's async library.
- fixnumgrpc depends on itProvides 32‑ and 64‑bit signed fixed‑width integer types for Dart.
- protobufgrpc depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.
- googleapis_authgrpc depends on itObtain Access credentials and authenticated HTTP clients for Google APIs using OAuth 2.0.
- http2grpc depends on itAn HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.