Skip to content

How to get cache size in folder cache #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yeikel16 opened this issue Apr 29, 2019 · 4 comments
Closed

How to get cache size in folder cache #83

yeikel16 opened this issue Apr 29, 2019 · 4 comments

Comments

@yeikel16
Copy link

I want to know the size of the cache folder. There is some method that debits the size of that folder.

@lijy91
Copy link

lijy91 commented Jun 21, 2019

My solution:

String cacheSize = '0 MB';
final directory = Directory(await DefaultCacheManager().getFilePath());
if (directory.existsSync()) {
  FileStat fileStat = directory.statSync();
  cacheSize = '${(fileStat.size / 1024.0).toStringAsFixed(2)} MB';
}
print(cacheSize);

@yeikel16
Copy link
Author

@lijy91 gracias !!

@DSPerson
Copy link

getFilePath this function not found

@yeikel16
Copy link
Author

@DSPerson This method was withdrawn by decision of the author, for more information you can see it here !!
#239 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants