Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
749 stars 438 forks source link

Get cache size #239

Closed alr2413 closed 2 months ago

alr2413 commented 3 years ago

Hi, in the previous version 1.x.x, we can use the await DefaultCacheManager().getFilePath() syntax to get the default cache directory path. how should we get that path in the new version 2 since there is no "getFilePath()" method anymore? Thanks in advance

renefloor commented 3 years ago

What's the usecase that you need to know the directory path?

alr2413 commented 3 years ago

To calculate the cache size as mentioned in #83

renefloor commented 3 years ago

I've been thinking about adding the getFilePath again, but that is not really a great solution. For example for web there is not really a path, so it wouldn't be consistent over platforms. I think it is better to implement a method to get the cache size. Would that be a good alternative for you?

alr2413 commented 3 years ago

Yea, i've checked the previous version of the package and figured out how to add the "getFilePath" method to my custom implementation. Thanks.

kamike commented 3 years ago

same question

esiqveland commented 3 years ago

Is there currently a way to get the total size of cache and the number of objects cached?

aintend-com commented 1 year ago

Is this implemented?

jithware commented 1 year ago

@renefloor how about something like:

https://github.com/jithware/flutter_cache_manager/blob/develop/flutter_cache_manager/lib/src/cache_store.dart#L194-L198

Nico04 commented 11 months ago

Related to https://github.com/Baseflow/flutter_cache_manager/issues/398