contains method

  1. @override
Future<bool> contains(
  1. String key
)
override

Checks if the cache contains an entry for the given key.

Implementation

@override
Future<bool> contains(String key) async {
  final cache = await getApplicationCacheDirectory();
  final filePathBytes = utf8.encode(key);
  final filePath = sha256.convert(filePathBytes).toString();
  final file = File('${cache.path}/cross_cache/$filePath');

  return file.exists();
}