rpc-dart
Generates typed Dart bindings from tRPC v11 and oRPC TypeScript routers, with a runtime for Flutter and Dart clients.
At a Glance
MIT-licensed rpc-dart CLI and trpc_dart runtime, free to use, copy, modify and distribute.
Engagement
Available On
Listed Dec 2026
About rpc-dart
rpc-dart is an MIT-licensed toolkit for calling tRPC v11 and oRPC backends from Dart and Flutter with end-to-end type safety. A Node CLI reads a TypeScript router and generates plain Dart bindings, and the trpc_dart runtime talks to the server over the real tRPC and oRPC wire protocols.
What It Is
rpc-dart bridges a TypeScript backend and a Dart client. The rpc-dart CLI extracts the router, builds an intermediate contract, and writes Dart 3 code with const constructors, copyWith, value equality and fromJson/toJson. The generated code does not need build_runner, freezed or json_serializable. Renaming a procedure or changing a Zod field regenerates the bindings, and the Dart analyzer then flags stale call sites.
Generation Workflow
After installing the CLI as a dev dependency, init detects the router, tsconfig and Flutter target and scaffolds rpc-dart.config.ts. watch regenerates Dart output on router changes, and generate writes only when the contract hash changed. check is a CI gate that fails on drift. diff categorizes breaking and non-breaking changes. doctor validates the environment, and clean removes only files listed in the manifest.
Runtime and Link Pipeline
The runtime exposes .query(), .mutate(), .safeQuery() and .safeMutate() calls. A composable link pipeline includes AuthLink with single-flight token refresh, RetryLink, LoggingLink with redaction, and HttpBatchLink for batching and SuperJSON. Per-call context carries headers, timeouts and cancellation. A built-in RpcQueryCache with invalidation streams and a Flutter ValueListenable bridge work with setState, BLoC, Provider, Riverpod or no state manager.
Protocol Coverage
Subscriptions run over SSE or WebSocket with resume and reconnect. oRPC contracts and routers are supported through an adapter covering Zod, Valibot and ArkType. Files and binary data transfer with progress callbacks. Server enum additions decode to unknown sentinels instead of crashing, and RpcOpt<T> models omitted, null and set values for PATCH-style updates.
Collections
Popular collections
- Charts, Graphs, and Diagrams
Collection by @joemseifi
- Pick Up Where Your Agent Left Off
Collection by @caiovalverde
- Give Your Agent Design Taste
Collection by @linetwk
- UI Design Skills for Coding Agents
Collection by @mayachen
Add rpc-dart to one of your collections.
Community Discussions
Be the first to start a conversation about rpc-dart
Share your experience with rpc-dart, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
MIT-licensed rpc-dart CLI and trpc_dart runtime, free to use, copy, modify and distribute.
- rpc-dart CLI generates Dart bindings from a TypeScript tRPC v11 or oRPC router
- trpc_dart runtime with composable link pipeline and query cache
- Real-time subscriptions over SSE or WebSocket
- oRPC support via @rpc-dart/orpc-adapter
- Binary and file transfers
Capabilities
Key Features
- Dart bindings generated from TypeScript tRPC v11 routers
- oRPC contract and router support
- No build_runner or freezed required
- Correct Zod input/output type handling
- Three-state PATCH semantics with RpcOpt
- Unknown-safe enums and sealed unions
- Built-in query cache with watch and invalidation
- Flutter ValueListenable bridge
- SSE and WebSocket subscriptions with reconnect
- Composable link pipeline (auth, retry, batching, logging)
- SuperJSON support
- File and binary transfers with progress
- CLI commands: init, generate, watch, check, diff, doctor, clean
