addResponse method

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

Add response to existing alice http call

Implementation

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

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

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