getData<KT, VT> method
Future<RespData<VT?> >
getData<KT, VT>({
- dynamic data,
- bool slient = false,
- required String url,
- required dynamic encodeDataFunction(
- RespData resp
- ClassBuffer<
KT, VT> ? buffer, - 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;
}