XRPCClient class final
A single XRPC client for any lexicon method descriptor.
Generated lexicons provide typed descriptors; the client only needs shared
transport and service configuration. Use call with any generated
method value or methodDescriptor, regardless of lexicon namespace.
Constructors
-
XRPCClient({Map<
String, String> ? headers, Protocol protocol = Protocol.https, String service = defaultService, String relayService = defaultRelayService, Duration timeout = const Duration(seconds: 10), HeaderBuilder? headerBuilder, GetClient? getClient, PostClient? postClient}) -
Returns a client configured for the selected service.
const
Properties
- getClient → GetClient?
-
Optional GET implementation, mainly for tests.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerBuilder → HeaderBuilder?
-
Builds request headers just before sending.
final
-
headers
→ Map<
String, String> ? -
Headers applied to every request.
final
- postClient → PostClient?
-
Optional POST implementation, mainly for tests.
final
- protocol → Protocol
-
The protocol used to build HTTP request URLs.
final
- relayService → String
-
The default relay service host.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- service → String
-
The default service host.
final
- timeout → Duration
-
The request timeout.
final
Methods
-
call<
P, I, O> (XRPCMethod< P, I, O> method, {String? service, Map<String, String> ? headers, P? parameters, I? input}) → Future<XRPCResponse< O> > - Executes any generated query or procedure descriptor.
-
get<
T> (NSID methodId, {String? service, Map< String, String> ? headers, Map<String, dynamic> ? parameters, ResponseDataBuilder<T> ? to, ResponseDataAdaptor? adaptor}) → Future<XRPCResponse< T> > - Executes a raw XRPC query.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post<
T> (NSID methodId, {String? service, Map< String, String> ? headers, Map<String, dynamic> ? parameters, dynamic body, ResponseDataBuilder<T> ? to}) → Future<XRPCResponse< T> > - Executes a raw XRPC procedure.
-
stream<
T> (NSID methodId, {String? service, Map< String, dynamic> ? parameters, ResponseDataBuilder<T> ? to, ResponseDataAdaptor? adaptor}) → XRPCResponse<Subscription< T> > - Subscribes to a raw XRPC event stream.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited