doPostMethod method
void
doPostMethod(])
Implementation
void doPostMethod(OnInterfaceCallbackListener listener, Map<String, dynamic> passParaMap,
String? apiName, String? apiNamePageRef, [String? previousCancelled]) async {
if (previousCancelled == 'CANCELLED') {
currentCall?.cancel();
}
currentCall = CancelToken();
try {
final response = await dio.post(
apiName ?? '',
data: passParaMap,
cancelToken: currentCall,
);
_handleResponse(response, listener, apiNamePageRef);
} on DioException catch (e) {
if (CancelToken.isCancel(e)) {
return;
}
_handleDioError(e, listener, apiNamePageRef);
} catch (e) {
listener.onFetchComplete(700, 'ERROR', apiNamePageRef);
}
}