delete static method

Future delete({
  1. bool auth = false,
  2. required String apiURL,
})

Implementation

static Future<dynamic> delete(
    {bool auth = false, required String apiURL}) async {
  try {
    var response = await http
        .delete(Uri.parse(ApiClient.baseUrl + apiURL),
            headers: ApiClient.headers(auth: auth, token: null))
        .timeout(const Duration(seconds: timeOutDuration));
    return ApiClient.processResponse(response);
  } on SocketException {
    throw FetchDataException('No Internet connection', '');
  } on TimeoutException {
    throw ApiNotRespondingException('API not responded in time', '');
  }
}