delete method

Future<void> delete()

Deletes the document referred to by this DocumentReference.

Returns a Future that will be resolved when the delete completes, that is when the backend has acknowledged it. Deleting a document that does not exist succeeds. The subcollections of the document are not deleted. As with set, the delete is applied to the local cache at once and the future does not complete while the client is offline.

await firestore.doc('cities/SF').delete();

Implementation

Future<void> delete() {
  return voidErrorTransformer(
    () => firestore.client.write(<DeleteMutation>[
      DeleteMutation(key, Precondition.none),
    ]),
  );
}