purgeAll method

  1. @override
  2. @override
Future<void> purgeAll()
override

Purges the whole cache. The cache can be used afterwards but will not return any items

Implementation

@override
@override
Future<void> purgeAll() async {
  int count = 0;
  for (String file in []..addAll(_files)) {
    //_log.info("  purging file from cache: $file");
    try {
      bool ok = await FileHelper.delete(file);
      if (ok) ++count;
    } catch (error) {
      // do nothing
    }
  }
  _log.info("purged $count files from FileTileBitmapCache $renderkey");
  _files.clear();
}