remote_caching library
A Flutter package for caching remote API calls with configurable duration.
This library provides a simple yet powerful way to cache remote API responses locally using SQLite, with support for automatic expiration, custom serialization, and intelligent cache management.
Quick Start
import 'package:remote_caching/remote_caching.dart';
// Initialize the cache system
await RemoteCaching.instance.init();
// Cache a remote API call
final data = await RemoteCaching.instance.call<MyData>(
'cache_key',
remote: () async => await fetchData(),
fromJson: (json) => MyData.fromJson(json as Map<String, dynamic>),
);
Exported Classes and Functions
- RemoteCaching - The main class for managing remote caching operations
- CachingStats - Statistics about the current cache state
- getInMemoryDatabasePath - Utility for creating in-memory databases (testing)
For detailed documentation and examples, see the individual class documentation.
Classes
- CachingStats
- Statistics about the current state of the cache.
- RemoteCaching
- A Flutter package for caching remote API calls with configurable duration.
Functions
-
getInMemoryDatabasePath(
) → String - Returns the path for an in-memory database.