delete static method

dynamic delete(
  1. String url,
  2. BuildContext? context, {
  3. Map<String, dynamic>? params,
  4. String? alertTitle,
  5. bool auth = true,
  6. Map<String, String>? headers,
  7. Function? onStart,
  8. Function? onSuccess,
  9. Function? onFinish,
  10. Function? onError,
  11. bool silent = false,
  12. bool mock = false,
})

Implementation

static delete(String url, BuildContext? context,
    {Map<String, dynamic>? params,
    String? alertTitle,
    bool auth = true,
    Map<String, String>? headers,
    Function? onStart,
    Function? onSuccess,
    Function? onFinish,
    Function? onError,
    bool silent = false,
    bool mock = false}) {
  if (params == null) {
    params = Map.fromEntries({});
  }

  String method = 'DELETE';

  if (mock) {
    params['_method'] = method;
    method = 'POST';
  }

  return _requestCall(method, url, context,
      params: params,
      alertTitle: alertTitle,
      auth: auth,
      headers: headers,
      onStart: onStart,
      onSuccess: onSuccess,
      onFinish: onFinish,
      onError: onError,
      silent: silent);
}