trpc_client 0.3.0 copy "trpc_client: ^0.3.0" to clipboard
trpc_client: ^0.3.0 copied to clipboard

A minimal trpc client for Dart and Flutter.

example/main.dart

// Import package
import "package:trpc_client/trpc_client.dart";

// Instantiate the client
final client = TRPCClient(
  baseUri: "https://example.com/trpc",
  headers: {"x-trpc-source": "Dart App"},
);

void main() async {
  // Run query request
  final response = await client
      .query<Map<String, dynamic>>("route", payload: {"userId": "example"});

  if (response.isError) {
    print(response.errors);
  } else {
    final data = response.successResponse.data;
  }
}
10
likes
0
points
38
downloads

Publisher

verified publisherwosher.co

Weekly Downloads

A minimal trpc client for Dart and Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, queue

More

Packages that depend on trpc_client