Open ZoomZhao opened 4 years ago
Hi, This is a good feature request. There is still some work to do with cache management (pre-cache is on the list too).
As of now, you have to import a private file:
import 'package:lottie/src/providers/lottie_provider.dart' show sharedLottieCache;
main() {
sharedLottieCache.clear();
}
This is a temporary hack that may not work in the future.
Otherwise, you can also not use Lottie.asset
and Lottie.network
and do the loading/caching yourself:
See: https://github.com/xvrh/lottie-flutter/blob/master/example/lib/examples/custom_load.dart
sharedLottieCache.clear();
i had try this, but Memory reduction is very limited, seems json or image not release.
imageProvider?.evict()
seems work.
imageProvider?.evict()
seems work.
lottie: ^0.7.0+1 not found imageProvider?.evict(), Which file should I refer to? Thank you.
There is LottieCache in lottie_provider.dart. can i clear the Cache after page disposed?