flutter_cache_manager
flutter_cache_manager copied to clipboard
Get cache size
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
What's the usecase that you need to know the directory path?
To calculate the cache size as mentioned in #83
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?
Yea, i've checked the previous version of the package and figured out how to add the "getFilePath" method to my custom implementation. Thanks.
same question
Is there currently a way to get the total size of cache and the number of objects cached?
Is this implemented?
@renefloor how about something like:
https://github.com/jithware/flutter_cache_manager/blob/develop/flutter_cache_manager/lib/src/cache_store.dart#L194-L198
Related to https://github.com/Baseflow/flutter_cache_manager/issues/398