callWithoutToken method
Future
callWithoutToken(})
Implementation
Future<dynamic> callWithoutToken(
String data, BuildContext? context, String url,
{Function? noNetworkCallBack,
Function(BuildContext)? sessionExpiredCallback,String? clientId,String? clientSecret}) async {
log(url, name: "Api Url");
var headers = {"Content-Type": 'application/json'};
if(clientId!=null && clientSecret!=null){
headers.putIfAbsent("X-Client-Id",()=>clientId);
headers.putIfAbsent("X-Client-Secret",()=>clientSecret);
}
log(headers.toString(), name: "Headers");
return _netUtil
.post(context, url,
body: data,
headers: headers,
noNetworkCallBack: noNetworkCallBack,
sessionExpiredCallback: sessionExpiredCallback)
.then((dynamic res) {
return _decoder.convert(res.toString());
});
}