On the Read Data example of Firestore this link I don't understand why it is necessary to include de snapshot.hasData to prove that the document does not exist.
if (snapshot.hasData && !snapshot.data!.exists) {
return Text("Document does not exist");
}