flutter_cache_manager icon indicating copy to clipboard operation
flutter_cache_manager copied to clipboard

Stale period not working properly

Open RezaMahdinezhad opened this issue 1 year ago • 0 comments

` Im using flutter_cache_manager: ^3.3.1 and the stale period its not working properly. its not automatically deleting the files.

final cacheManager = CacheManager(
  Config(
    id,
    stalePeriod: Duration(seconds: 60),
    maxNrOfCacheObjects: 10,
  ),
);

try {
  final fileStream = cacheManager.getFileStream(_syncMusicUrl);

  await for (var response in fileStream) {
    if (response is FileInfo) {
      _cacheMusicPath = response.file.path;

      return true;
    } else if (response is DownloadProgress) {}
  }
  return false;
} catch (error) {
  syncSituation.value = "sync";
  update();
  return false;
} }`

RezaMahdinezhad avatar Apr 22 '24 13:04 RezaMahdinezhad