title: Firebase check if email exists without registering user - flutter
body: <p>In flutter i want to check if the user's email exists in the firebase auth without registering the user. If the email does exist then it would show a different form to tell the user to login. Otherwise they would go to a questions page which they would finish first before registering the user onto the database.</p>
  <p>My code that calls the firebase create user method</p>
  <pre><code>  void validateAndSubmit() async {
      setState(() {
        _errorMessage = &quot;&quot;;
        _isLoading = true;
      });
      if (validateAndSave()) {
        String userId = &quot;&quot;;
        try {
          userId = await widget.auth.signUp(_email, _password);
          print('Signed up user: $userId');
  
          setState(() {
            _isLoading = false;
          });
        } catch (e) {
          print('Error: $e');
          setState(() {
            Navigator.push(context,
                MaterialPageRoute(builder: (context) =&gt; QuestionsPage()));
            _isLoading = false;
            _errorMessage = e.message;
            _formKey.currentState.reset();
          });
        }
      }
    }
  </code></pre>
  <p>My file where the auth method code is stored</p>
  <pre><code>  Future&lt;String&gt; signUp(String email, String password) async {
      AuthResult result = await _firebaseAuth.createUserWithEmailAndPassword(
          email: email, password: password);
      FirebaseUser user = result.user;
      return user.uid;
    }
  </code></pre>