hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

Why when closing an app cache cleared #31

Closed pitiphat closed 4 years ago

pitiphat commented 4 years ago

Hello i'm beginner

Why when closing an app cache cleared.

var _dio = Dio();
var _dioCacheManager = new DioCacheManager(CacheConfig(baseUrl: url));
_dio.interceptors.add(_dioCacheManager.interceptor);

var response = await _dio.post("${url}",
    data: params,
    options: buildCacheOptions(
      Duration(days: 3),
      maxStale: Duration(days: 7),
    ));
pitiphat commented 4 years ago

i change param and clean project it work Map<String, String> param = { "xxxx": "${xxx}", "xxxx": "xxxx" };

to

var param= {'xxx': _xxx, "xxx": "xxx"};