flutter_api_cache library

A powerful, lightweight API response caching solution for Flutter with TTL, offline-first support, stale-while-revalidate, and Dio interceptor.

Classes

ApiCacheManager
The main public API of the flutter_api_cache package.
CacheConfig
Global configuration for the entire cache system.
CacheEntry
Represents a single cached API response with metadata for expiration, access tracking, and serialization.
CacheInterceptor
A Dio Interceptor that automatically handles caching of API responses.
CacheKeyBuilder
Generates unique, consistent cache keys from API requests.
CachePolicy
Configures caching behavior for a specific endpoint or group of endpoints.
CacheStats
A simple data class containing cache statistics.
CacheStorage
Abstract interface for all cache storage implementations.
ConnectivityChecker
Provides a simple way to check whether the device is online or offline.
EvictionManager
Handles removing old or excess cache entries based on TTL expiry, maximum entry count, and maximum size constraints.
HiveCacheStorage
Persistent disk-based cache storage implementation using Hive.
MemoryCacheStorage
An in-memory LRU (Least Recently Used) cache implementation of CacheStorage.

Enums

CacheStrategy
Defines the caching strategy used when making API requests.

Constants

cachePolicyKey → const String
The key used to attach a CachePolicy to a Dio request's RequestOptions.extra map.