exists method

Future<bool> exists()

Checks if the document exists in Firestore.

Implementation

Future<bool> exists() async {
  var documentReference = selfCollection.doc(id);
  var snapshot = await documentReference.get();
  return snapshot.exists;
}