Added method for verifying user existance
This commit is contained in:
parent
f296eb94e7
commit
b009cb7462
1 changed files with 8 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue