delete method

Future<void> delete(
  1. String endpoint,
  2. int id
)

Implementation

Future<void> delete(String endpoint, int id) async {
  final response = await http.delete(Uri.parse('$baseUrl/$endpoint/$id'));

  if (response.statusCode != 204) {
    throw Exception('Erro na chamada de serviço: ${response.statusCode}');
  }
}