PoptartClient class sealed
A single app-facing client for authenticated and anonymous XRPC calls.
The low-level descriptor transport lives in poptart_xrpc, while this
client adds AT Protocol session, OAuth, retry, DPoP, and PDS endpoint
handling without making callers hop through a nested transport object.
Constructors
-
PoptartClient.anonymous({Map<
String, String> ? headers, Protocol? protocol, String? service, String? relayService, Duration? timeout, RetryConfig? retryConfig, GetClient? getClient, PostClient? postClient}) -
Returns a new anonymous client.
factory
-
PoptartClient.fromOAuthSession(OAuthSession session, {Map<
String, String> ? headers, Protocol? protocol, String? service, String? relayService, Duration? timeout, RetryConfig? retryConfig, GetClient? getClient, PostClient? postClient}) -
Returns a new authenticated client backed by an OAuth session.
factory
-
PoptartClient.fromSession(Session session, {Map<
String, String> ? headers, Protocol? protocol, String? service, String? relayService, Duration? timeout, RetryConfig? retryConfig, GetClient? getClient, PostClient? postClient}) -
Returns a new authenticated client backed by an app-password session.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Returns the global headers without auth headers.
no setter
- oAuthSession → OAuthSession?
-
Returns the current OAuth session, when present.
no setter
- relayService → String
-
Returns the current relay service.
Defaults to
bsky.network.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- service → String
-
Returns the current service.
Defaults to
bsky.social, or the PDS endpoint from the session.no setter - session → Session?
-
Returns the current app-password session, when present.
no setter
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 method.
-
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, {Map< String, dynamic> ? parameters, ResponseDataBuilder<T> ? to, ResponseDataAdaptor? adaptor}) → Future<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