read method

  1. @override
Future<String?> read({
  1. required String key,
})
override

Read a value from the cache.

Implementation

@override
Future<String?> read({required String key}) async {
  final hashedKey = hashKey(key);
  try {
    return _inMemoryCache[hashedKey] ?? _box.get(hashedKey);
  } catch (e) {
    await _box.delete(hashedKey);
    return null;
  }
}