delete method

Future<void> delete()

Deletes the collection referred to by this CollectionReference.

Implementation

Future<void> delete() async {
  final response = await service._delete(collectionUriByID);

  int httpStatusCode = response.statusCode;
  if (httpStatusCode == HttpStatus.ok) {
    _id = -1;
    return;
  } else {
    final Map<String, dynamic> responseJson =
        json.decode(response.body) as Map<String, dynamic>;
    throw CarpServiceException.fromMap(httpStatusCode, responseJson);
  }
}