addResponse method
Add response to existing nirikshak http call
Implementation
void addResponse(NirikshakHttpResponse? response, int? requestId) {
assert(response != null, "response can't be null");
assert(requestId != null, "requestId can't be null");
if (response == null || requestId == null) {
return;
}
final selectedCall = _selectCall(requestId);
if (selectedCall.id == -1) {
if (kDebugMode) log("Selected call is null");
return;
}
selectedCall.loading = false;
selectedCall.response = response;
if (selectedCall.request?.time.millisecondsSinceEpoch != null) {
selectedCall.duration = response.time.millisecondsSinceEpoch -
selectedCall.request!.time.millisecondsSinceEpoch;
}
}