title: How to add email verification in this flutter? I need to verify users before signing them in
body: <p>This code must provide me email verification for the user when they click sign in firstly they have to verify their mail afterwards they can sign in</p>
  <pre><code>            onPressed: () async{
  
                        if (nameTextEditingController.text.length &lt; 4) {
                           displayToastMessage(
                               &quot;Username Must be atleast 4 characters&quot;,
                               context);
                        } else if (!emailTextEditingController.text
                            .contains(&quot;@&quot;)) {
                          displayToastMessage(&quot;Email is not Valid &quot;, context);
                        } else if ((phoneTextEditingController.text.length &lt;10 )) {
                          displayToastMessage(
                              &quot;Invalid Phone number  &quot;, context);
                        } else if (passwordTextEditingController.text.length &lt;
                            7) {
                          displayToastMessage(
                              &quot;Password must be 6 characters long&quot;, context);
                        } else {
                          registerNewUser(context);
                        }
  
  
  
  
  
                      }),
                ],
              ),
            ),
            FlatButton(
                onPressed: () {
  
                  Navigator.pushNamedAndRemoveUntil(
                      context, LoginScreen.idscreen, (route) =&gt; false);
                },
                child: Text(&quot;Already have an Account ? Login Here&quot;,style: TextStyle(fontSize: 17,color: Colors.white),)),
          ],
        ),
      ),
    ),
  );
  
  
       final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
  
       void registerNewUser(BuildContext context) async {
  
  
  
  
  showDialog(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context)
      {
        return ProgressDialog(message: &quot;Signing In , please wait....&quot;,);
      });
  
  
  
  final User firebaseUser = (await _firebaseAuth
          .createUserWithEmailAndPassword(
              email: emailTextEditingController.text,
              password: passwordTextEditingController.text)
          .catchError((errMsg){
            Navigator.pop(context);
            displayToastMessage(&quot;Error:&quot;+errMsg.toString(), context);
  
  
  
  })
  )
      .user;
  
  if (firebaseUser != null) //user has been created
  {
    Map userDataMap = {
      &quot;name&quot;: nameTextEditingController.text.trim(),
      &quot;email&quot;: emailTextEditingController.text.trim(),
      &quot;phone&quot;: phoneTextEditingController.text.trim(),
    };
  
    usersRef.child(firebaseUser.uid).set(userDataMap);
    displayToastMessage(&quot;Welcome to Yatra. Book ride as you like&quot;, context);
  
    Navigator.pushNamedAndRemoveUntil(
         context, MainScreen.idscreen, (route) =&gt; false);
  
  
      } else {
    Navigator.pop(context);
    //if error display messages
    displayToastMessage(&quot;UserAccount hasn't been Created&quot;, context);
  
    }
      }
  
  
         }
  
         displayToastMessage(String message, BuildContext context)
           {
        Fluttertoast.showToast(msg: message);
          }
  </code></pre>
  <p>I came across the sendEmailVerification(); method provided by firebase_auth package, but need some advice on setting it up. Does anyone have a working code example to follow?</p>