APIClient class

Production API client for backend operations.

Matches iOS APIClient actor. Implements NetworkService protocol for real network calls.

Implemented types

Constructors

APIClient({required Uri baseURL, required String apiKey, Client? httpClient})

Properties

apiKey String
final
baseURL Uri
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get<T>(APIEndpoint endpoint, {required bool requiresAuth, required T fromJson(Map<String, dynamic>)}) Future<T>
Perform a GET request with typed response.
override
getRaw(APIEndpoint endpoint, {required bool requiresAuth}) Future<Uint8List>
Perform a raw GET request (returns raw bytes).
override
getWithPath<T>(String path, {required bool requiresAuth, required T fromJson(Map<String, dynamic>)}) Future<T>
Perform a GET with custom path (for parameterized endpoints).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(APIEndpoint endpoint, Object payload, {required bool requiresAuth, required T fromJson(Map<String, dynamic>)}) Future<T>
Perform a POST request with typed payload and response.
override
postRaw(APIEndpoint endpoint, Uint8List payload, {required bool requiresAuth}) Future<Uint8List>
Perform a raw POST request (returns raw bytes).
override
postWithPath<T>(String path, Object payload, {required bool requiresAuth, required T fromJson(Map<String, dynamic>)}) Future<T>
Perform a POST with custom path (for parameterized endpoints).
override
setAuthTokenProvider(AuthTokenProvider provider) → void
Set the authentication token provider (called after AuthenticationService is created).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited