delete<T> method

Future<HttpResponse<T>> delete<T>(
  1. String uri, {
  2. dynamic data,
  3. Map<String, dynamic>? queryParameters,
  4. Options? options,
  5. CancelToken? cancelToken,
  6. HttpTransformer? httpTransformer,
  7. bool isShowLoading = true,
})

Implementation

Future<HttpResponse<T>> delete<T>(String uri,
    {data,
      Map<String, dynamic>? queryParameters,
      dio.Options? options,
      dio.CancelToken? cancelToken,
      HttpTransformer? httpTransformer,
      bool isShowLoading = true}) async {
  try {
    if(isShowLoading) EasyLoading.show(status: 'loading...');
    var response = await _dio.delete(
      uri,
      data: data,
      queryParameters: queryParameters,
      options: options,
      cancelToken: cancelToken,
    );
    if(isShowLoading) EasyLoading.dismiss();
    return handleResponse(response, httpTransformer: httpTransformer);
  } on Exception catch (e) {
    return handleException(e);
  }
}