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 {
  final File cacheFile = File('${_cacheDirectory.path}/$key');
  if (await cacheFile.exists()) {
    await cacheFile.delete();
  }
}