SmartDioClient class
A smart HTTP client that provides transport-agnostic HTTP operations with caching, queuing, retry mechanisms, and comprehensive logging.
This class serves as the main entry point for all HTTP operations and orchestrates various features like offline caching, request deduplication, connectivity management, and performance monitoring.
Constructors
-
SmartDioClient({required HttpClientAdapter adapter, SmartDioConfig? config, SmartLogger? logger, PerformanceMetrics? metrics, ConnectivityManager? connectivityManager, RequestQueue? requestQueue, CacheStore? cacheStore, List<
SmartDioInterceptor> ? interceptors}) - Creates a new SmartDioClient with the specified configuration.
Properties
- config → SmartDioConfig
-
no setter
- connectivity → ConnectivityManager
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- interceptors → InterceptorChain
-
no setter
- logger → SmartLogger
-
no setter
- metrics → PerformanceMetrics
-
no setter
- queue → RequestQueue
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelAll(
) → void -
cancelByCorrelationId(
String correlationId) → void -
cancelByTag(
String tag) → void -
delete<
T> (String url, {Map< String, String> ? headers, RequestConfig? config, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
dispose(
) → Future< void> -
execute<
T> ({required String method, required String url, Map< String, String> ? headers, dynamic body, RequestConfig? requestConfig, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
get<
T> (String url, {Map< String, String> ? headers, RequestConfig? config, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch<
T> (String url, {Map< String, String> ? headers, dynamic body, RequestConfig? config, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
post<
T> (String url, {Map< String, String> ? headers, dynamic body, RequestConfig? config, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
put<
T> (String url, {Map< String, String> ? headers, dynamic body, RequestConfig? config, required T transformer(dynamic data)}) → Future<SmartDioResponse< T> > -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited