compareSnapshotData method
compareSnapshotData...
Implementation
Future<void> compareSnapshotData(String collectionName, String value,
String fieldName, var successfulFunction, var failedFunction) async {
QuerySnapshot snapshot = await FirebaseFirestore.instance
.collection(collectionName)
.where(fieldName, isEqualTo: value)
.get()
.then((value) => successfulFunction())
.onError((error, stackTrace) => failedFunction())
.timeout(const Duration(seconds: 30));
}