Launching today

rpc-dart
Type-safe tRPC v11 client for Flutter apps
2 followers
Type-safe tRPC v11 client for Flutter apps
2 followers
Bring tRPC’s end-to-end type safety to Flutter and Dart without OpenAPI or build_runner. rpc-dart uses TypeScript’s compiler API to generate zero-cast Dart models and clients with SuperJSON, HTTP batching, and an agnostic reactive cache runtime.



Launch Team

AdsGPTManage all your ad platforms with one AI agent
Promoted
Hey Product Hunt! 👋
Not long ago I was building a monorepo with a Node.js + Fastify backend using tRPC. The backend DX was awesome — until I had to build the mobile app. With a few years of Flutter and zero React Native experience, I chose Flutter and quickly realized there was no proper tRPC integration for Dart. I ended up hand-writing DTOs and HTTP wrappers again, losing the tight end-to-end type safety that makes tRPC great in the first place.
So I built rpc-dart (and trpc_flutter).
Instead of routing through OpenAPI or relying on Dart's `build_runner`, `rpc-dart` uses the TypeScript Compiler API (`ts.TypeChecker`) directly against your tRPC v11 router and generates standalone, zero-cast Dart 3 models and clients (`npx rpc-dart generate`).
What's included in v0.1:
- Zero `build_runner` or `freezed`: Outputs pure, immutable Dart 3 classes, sealed unions, and nested router clients with pattern-matched `RpcJson` decoders (zero raw `as` casts).
- True wire semantics: Preserves `z.input` vs. `z.output` transforms, supports SuperJSON (`DateTime`, `BigInt`, `Set`, `Map`, `Uri`), and uses 3-state `RpcOpt<T>` so `PATCH` mutations distinguish omitted keys from `null`.
- Composable link pipeline & cache runtime: Includes microtask `HttpBatchLink`, single-flight `AuthLink` refresh, `RetryLink`, and a lightweight `RpcQueryCache` + `ValueListenable` bridge that drops into `setState`, Riverpod, BLoC, or Provider.
Queries, mutations, and HTTP batching work out of the box today, with subscriptions and oRPC support on the roadmap.
It's 100% open source on GitHub with full docs and a runnable Fastify + Flutter example. Would love your feedback, stars, or contributions!