clear method

Future<void> clear(
  1. String key
)

Removes a specific item from the cache.

key is the unique identifier of the item to be removed.

Implementation

Future<void> clear(String key) async {
  if (!isAvailable) return;

  final cacheFile = _fileFor(key);
  if (await cacheFile.exists()) {
    await cacheFile.delete();
  }
}