write method

  1. @override
Future<void> write(
  1. String key,
  2. T value, {
  3. Duration? ttl,
})
override

Writes a value to the cache.

Implementation

@override
Future<void> write(String key, T value, {Duration? ttl}) async {
  await _cache.write(key, value);
  if (ttl != null) {
    await _cacheExpiryTimes.write(key, _now().add(ttl));
  }
}