ApiClientConfig class

Configuration for ApiClient.

Provide either getAccessToken (callback) or tokenStorage for auth.

Constructors

ApiClientConfig({required String baseUrl, Future<String?> getAccessToken()?, TokenStorage? tokenStorage, Future<bool> refreshToken()?, Map<String, String> extraHeaders = const {}, Duration connectTimeout = const Duration(seconds: 30), String authScheme = 'Bearer', ResponseHandlerInterface? responseHandler, RequestInterceptor? requestInterceptor, ResponseInterceptor? responseInterceptor})
ApiClientConfig.withStorage({required String baseUrl, required TokenStorage tokenStorage, Future<bool> refreshToken()?, Map<String, String> extraHeaders = const {}, Duration connectTimeout = const Duration(seconds: 30), String authScheme = 'Bearer'})
Config with custom TokenStorage.
factory
ApiClientConfig.withToken({required String baseUrl, required Future<String?> getAccessToken(), Future<bool> refreshToken()?, Map<String, String> extraHeaders = const {}, Duration connectTimeout = const Duration(seconds: 30), String authScheme = 'Bearer'})
Config with callback-based token (no custom storage).
factory

Properties

authScheme String
final
baseUrl String
final
connectTimeout Duration
final
extraHeaders Map<String, String>
final
getAccessToken Future<String?> Function()?
final
hashCode int
The hash code for this object.
no setterinherited
refreshToken Future<bool> Function()?
final
requestInterceptor RequestInterceptor?
final
responseHandler ResponseHandlerInterface?
final
responseInterceptor ResponseInterceptor?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenStorage TokenStorage?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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