request method

void request({
  1. required Retrofit retrofit,
  2. Map<String, String>? headers,
  3. Map<String, dynamic>? params,
  4. OnResponseSuccessCall? successCall,
  5. OnResponseErrorCall? errorCall,
  6. OnResponseCompleteCall? completeCall,
})

网络请求实例 retrofit 请求对象 params 请求参数 responseCall 响应回调

Implementation

void request({
  required Retrofit retrofit,
  Map<String, String>? headers,
  Map<String, dynamic>? params,
  OnResponseSuccessCall? successCall,
  OnResponseErrorCall? errorCall,
  OnResponseCompleteCall? completeCall,
}) async {
  String requestId = Uuid().v4().toString();
  if (completeCall != null) {
    _requestActMap[requestId] = completeCall;
  }
  _requestForMap(
    retrofit: retrofit,
    headers: headers,
    params: params,
    requestId: requestId,
    responseCall: _InternalResponseCall(requestId, successCall, errorCall, completeCall),
    enableCache: true,
  );
}