simple key-value cache with Devtools Extension support
dart pub add content_cache
- Stream get onChangeStream;
- void save(Object key, T content, {Duration ttl});
- bool isExists(Object key);
- T? retrieve(Object key);
- T retrieveOrDefault(Object key, T defaultVal);
- void clearAll();
- void remove(Object key);
- void dispose();
flutter run -d chrome --dart-define=use_simulated_environment=true
also this package allows you to see the cache data real-time
import 'package:content_cache/content_cache.dart';
void main() {
final ContentCache contentCache = ContentCacheImpl.instance;
contentCache.save('counterKey', 'test1');
}