yPost<T extends dynamic> method

void yPost<T extends dynamic>(
  1. String jkid,
  2. Map? kv,
  3. dynamic yAjaxCallback(
    1. bool isSuccess,
    2. List<T>? results,
    3. String code,
    4. String message,
    ), {
  4. dynamic onModel(
    1. dynamic map
    )?,
  5. dynamic showProgress = true,
  6. dynamic showErrorToast = true,
  7. dynamic cacheEnable = false,
})

Implementation

void yPost<T extends dynamic>(String jkid, Map? kv, Function(bool isSuccess, List<T>? results, String code, String message) yAjaxCallback, {Function(dynamic map)? onModel, showProgress = true, showErrorToast = true, cacheEnable = false}) async {
  if (cacheEnable) {
    var cacheResult = await yRead(yGetPostCacheKey(jkid, kv));
    if (cacheResult != null) {
      Map<dynamic, dynamic> result = json.decode(cacheResult);
      _doYPostResult(jkid, kv, result, yAjaxCallback, onModel, showProgress, showErrorToast, cacheEnable, true);
      _doYPost(jkid, kv, yAjaxCallback, onModel, false, showErrorToast, true);
      return;
    }
  }
  _doYPost(jkid, kv, yAjaxCallback, onModel, showProgress, showErrorToast, cacheEnable);
}