RestApiClientImpl constructor
RestApiClientImpl({
- required RestApiClientOptions options,
- ExceptionOptions? exceptionOptions,
- LoggingOptions? loggingOptions,
- AuthOptions? authOptions,
- CacheOptions? cacheOptions,
- List<
Interceptor> interceptors = const [],
Implementation
RestApiClientImpl({
required RestApiClientOptions options,
ExceptionOptions? exceptionOptions,
LoggingOptions? loggingOptions,
AuthOptions? authOptions,
CacheOptions? cacheOptions,
List<Interceptor> interceptors = const [],
}) {
_options = options;
_exceptionOptions = exceptionOptions ?? ExceptionOptions();
_loggingOptions = loggingOptions ?? LoggingOptions();
_authOptions = authOptions ?? AuthOptions();
_cacheOptions = cacheOptions ?? CacheOptions();
_dio = Dio(BaseOptions(baseUrl: _options.baseUrl));
_dio.httpClientAdapter = getAdapter();
exceptionHandler = ExceptionHandler(exceptionOptions: _exceptionOptions);
authHandler = AuthHandler(
dio: _dio,
options: options,
exceptionOptions: _exceptionOptions,
authOptions: _authOptions,
loggingOptions: _loggingOptions);
cacheHandler = CacheHandler(
loggingOptions: _loggingOptions, cacheOptions: _cacheOptions);
_configureLogging();
_addInterceptors(interceptors);
_configureCertificateOverride();
}