Reputation: 377
I have a view pdf viewers in my app. These get the pdfs from a url and I switch the pdfs often. my problem is, that the pdfs get stored in the cache for a long time. So if I switch the pdfs and you have the old one still in cache, it will show the old one. Is it possible to clear the cache each time when the app starts?
Upvotes: 1
Views: 529
Reputation: 146
Just by checking the pdf viewers package, it uses this plugin : flutter_cache_manager
First make sure you can use this import.
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
..if not , you can install flutter_cache_manager first.
Then try something like this, inside your method.
DefaultCacheManager().emptyCache();
Upvotes: 1