title: Error handling pseudo already exists flutter firebase
body: <p>I have a small question about try/catch with dart.</p>
  <p>How can i add my script for check if a pseudo already exist in my function SignUp ?</p>
  <pre class="lang-dart prettyprint-override"><code>  _signUp(String _email, String _password, String _pseudo) async {
      try {
        //Create Get Firebase Auth User
        if (_formKey.currentState.validate()) {
          await auth.createUserWithEmailAndPassword(
              email: _email, password: _password);
  
          //problem here 
          users.get().then((querySnapshot) {
            querySnapshot.docs.forEach((result) {
              var pseudoDoc = result.data()['pseudo'];
              if (pseudoDoc != _pseudo) {
                users.doc(auth.currentUser.uid).set({
                  'pseudo': _pseudo,
                  'email': _email,
                });
              } else {
                throw 'Pseudo already exist';
              }
            });
          });
          //
        }
      } on FirebaseAuthException catch (error) {
        CoolAlert.show(
          context: context,
          type: CoolAlertType.error,
          text: error.message,
        );
      }
    }
  }```
  </code></pre>