Closed pishguy closed 3 years ago
clearing cache in this code doesn't work
static RestApi create() { final BaseOptions options = BaseOptions( connectTimeout: 5000, receiveTimeout: 6000, headers: {'Content-Type': 'application/json; charset=UTF-8'}, ); final cacheManager = DioCacheManager(CacheConfig(baseUrl: baseApiUrl)); cacheManager.clearAll(); final dio = Dio(options) ..interceptors.addAll([ cacheManager.interceptor as Interceptor, LogInterceptor(responseBody: true) ]); return _RestApi(dio); }
Hello, thanks for your feedback;
cacheManager.clearAll is a async method
cacheManager.clearAll
Please try:
await cacheManager.clearAll();
not work with me
after i close the app and open again it work
clearing cache in this code doesn't work