flutter_smartdio library

A transport-agnostic HTTP wrapper that enhances ANY HTTP client with offline caching, request queuing, retry mechanisms, and comprehensive logging.

This library provides a unified interface for working with multiple HTTP clients including Dio, HTTP, and Chopper while adding powerful features like:

  • Offline caching with multiple storage backends
  • Request queuing for network failures
  • Configurable retry policies
  • Performance metrics and logging
  • Connection management

Classes

CacheEntry
CacheEvictionEvent
CacheFirstCachePolicy
CacheHitEvent
CacheMetrics
CacheMissEvent
CacheOnlyCachePolicy
CachePolicy
Defines caching behavior for HTTP requests and responses.
CacheStore
ChopperClientAdapter
ColorfulConsoleLogSink
Enhanced console sink with colors and emojis for better visual output
ConnectivityInfo
Immutable class containing information about the current network connectivity.
ConnectivityManager
ConsoleLogSink
CustomMetricsEvent
CustomRetryPolicy
DioClientAdapter
ExponentialBackoffRetryPolicy
FixedDelayRetryPolicy
HiveCacheStore
Hive-based persistent cache store that survives app restarts
HiveQueueStorage
Hive-based persistent queue storage that survives app restarts
HttpClientAdapter
Abstract base class for HTTP client adapters that provide a unified interface for different HTTP clients (Dio, HTTP, Chopper).
HttpClientAdapterImpl
HttpPackageAdapter
InterceptorChain
LogEntry
Represents a single log entry with metadata and optional error information.
LogSink
MemoryCacheStore
MemoryQueueStorage
MetricsEvent
NetworkFirstCachePolicy
NetworkOnlyCachePolicy
NoCachePolicy
NoRetryPolicy
PerformanceMetrics
QueueCleared
QueuedRequest
Represents a queued HTTP request waiting to be executed.
QueueEvent
QueueItemAdded
QueueItemAddedEvent
QueueItemEvicted
QueueItemExpiredEvent
QueueItemFailed
QueueItemProcessedEvent
QueueItemRemoved
QueueItemRetried
QueueItemsExpired
QueueLoaded
QueueMetrics
QueuePaused
QueueResumed
QueueStorageError
RequestCompletedEvent
RequestConfig
RequestMetrics
Immutable class containing performance metrics for a single HTTP request.
RequestQueue
RequestQueueStorage
RetryPolicy
Defines retry behavior for failed HTTP requests.
SmartDioClient
A smart HTTP client that provides transport-agnostic HTTP operations with caching, queuing, retry mechanisms, and comprehensive logging.
SmartDioConfig
Configuration class for SmartDioClient that defines behavior for caching, retries, logging, and other advanced features.
SmartDioError<T>
SmartDioInterceptor
SmartDioRequest
Represents an HTTP request with all necessary information for execution.
SmartDioResponse<T>
Sealed class representing the result of an HTTP request execution.
SmartDioSuccess<T>
SmartLogger

Enums

ConnectionQuality
Enumeration of network connection quality levels.
ConnectivityStatus
Enumeration of possible network connectivity states.
LogLevel
Defines the severity levels for logging messages.
QueueStatus
QueueStorageType
Queue storage type options
SmartDioErrorType

Exceptions / Errors

AdapterException
Base exception class for all adapter-related errors.
BadResponseException
CancelledException
NetworkException
Exception thrown when network-related errors occur during HTTP requests.
TimeoutException
Exception thrown when HTTP requests exceed their timeout duration.
UnknownException