ApiClient class

Low-level HTTP engine managing connection lifecycles, interceptors, retries, and logging.

Constructors

ApiClient({ApiConfig? config, Client? httpClient})

Properties

authInterceptor → AuthInterceptor
final
cache → ApiCache
final
config ↔ ApiConfig
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
logger ↔ ApiLogger
getter/setter pair
retryPolicy ↔ RetryPolicy
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addInterceptor(ApiInterceptor interceptor) → void
Registers an interceptor into the execution pipeline.
clearInterceptors() → void
Clears all non-system interceptors.
dispose() → void
Closes underlying HTTP client.
download(String url, {required String savePath, Map<String, dynamic>? queryParameters, Map<String, String>? headers, ProgressCallback? onReceiveProgress, CancellationToken? cancellationToken, void onLoading(bool isLoading)?}) → Future<ApiResponse<File>>
Downloads a file from url and streams directly to disk at savePath.
execute<T>(ApiRequest request, {dynamic parser(dynamic json)?, bool isList = false, void onLoading(bool isLoading)?}) → Future<ApiResponse<T>>
Primary execution pipeline for all HTTP requests.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeInterceptor(ApiInterceptor interceptor) → void
Removes a registered interceptor.
toString() → String
A string representation of this object.
inherited
updateConfig(ApiConfig newConfig) → void
Updates client configuration.

Operators

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