Added method for verifying user existance

This commit is contained in:
Mariano Uvalle 2019-03-02 20:40:33 -06:00
parent f296eb94e7
commit b009cb7462

View file

@ -50,6 +50,14 @@ class FirestoreProvider {
}
}
Future<bool> userExists(String username) async {
final querySnapshot = await _firestore
.collection('users')
.where('username', isEqualTo: username)
.getDocuments();
return querySnapshot.documents.length > 0;
}
//-------------------------Task related operations----------------------------
/// Adds a task to firestore.