getData<KT, VT> method

Future<RespData<VT?>> getData<KT, VT>({
  1. dynamic data,
  2. bool slient = false,
  3. required String url,
  4. required dynamic encodeDataFunction(
    1. RespData resp
    ),
  5. ClassBuffer<KT, VT>? buffer,
  6. String method = "POST",
})

Implementation

Future<RespData<VT?>> getData<KT, VT>({
  dynamic data,
  bool slient = false,
  required String url,
  required Function(RespData resp) encodeDataFunction,
  ClassBuffer<KT, VT>? buffer,
  String method = "POST",
}) async {
  RespData<VT?> resp;
  if (buffer != null) {
    resp = await buffer.check(
      data: data,
      method: this,
      url: url,
      reqMethod: method,
      slient: slient,
      encodeDataFunction: encodeDataFunction,
    );
  } else {
    resp = await sendReq(url, data, method, slient);
    if (resp.code == 0) {
      encodeDataFunction(resp);
    }
    resp.res = null;
  }
  return resp;
}