deleteFromDB function

Future<Map> deleteFromDB({
  1. required String api,
  2. required String apiKey,
})

Generic Delete function to make delete API calls

Implementation

Future<Map> deleteFromDB({required String api, required String apiKey}) async {
  final http.Response response = await http.delete(
    Uri.parse(api),
    headers: <String, String>{
      'Content-Type': 'application/json',
      'X-CC-Version': '2018-03-22',
      'X-CC-Api-Key': apiKey,
    },
  );
  return jsonDecode(response.body);
}