xxxxxxxxxx
DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig());
Options _cacheOptions = buildCacheOptions(Duration(days: 7));
Dio _dio =Dio();
_dio.interceptors.add(_dioCacheManager.interceptor);
Response data =await _dio.get(pratinidhiandkarmachari, options: _cacheOptions);
List<dynamic> list = data.data;
print(list);
xxxxxxxxxx
You can also use use flutter_cache_manager to delete or remove your app's cache programatically.
After installing flutter_cache_manager , use this :
await DefaultCacheManager().emptyCache();