easy_data_cache 1.0.1
easy_data_cache: ^1.0.1 copied to clipboard
Key-value database with expiration time.
example/easy_data_cache_example.dart
import 'package:easy_data_cache/easy_data_cache.dart';
void main() async {
await EasyDataCache.init();
EasyDataCache.put('key', 'value', duration: Duration(seconds: 5));
// EasyDataCache.put('key', 'value', expirationDate: DateTime(2025, 1, 1));
print(EasyDataCache.get('key')); //value
await Future.delayed(Duration(seconds: 5));
print(EasyDataCache.get('key')); // null
}