addResponse method

void addResponse(
  1. AliceHttpResponse response,
  2. int requestId
)

Add response to existing alice http call

Implementation

void addResponse(AliceHttpResponse response, int requestId) {
  AliceHttpCall? selectedCall = _selectCall(requestId);

  if (selectedCall == null) {
    print("Selected call is null");
    return;
  }
  selectedCall.loading = false;
  selectedCall.response = response;
  selectedCall.duration = response.time.millisecondsSinceEpoch -
      selectedCall.request!.time.millisecondsSinceEpoch;

  callsSubject.add([...callsSubject.value]);
}