<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Fabusuyi David Oluwasegun</title>
    <description>The latest articles on Forem by Fabusuyi David Oluwasegun (@dav4thevid).</description>
    <link>https://forem.com/dav4thevid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F438231%2Fd74735cb-50c2-4935-9c17-1e224a72aee5.jpg</url>
      <title>Forem: Fabusuyi David Oluwasegun</title>
      <link>https://forem.com/dav4thevid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dav4thevid"/>
    <language>en</language>
    <item>
      <title>GUILD LINES TO LEARNING HOW TO CODE IN 2021</title>
      <dc:creator>Fabusuyi David Oluwasegun</dc:creator>
      <pubDate>Tue, 12 Jan 2021 01:16:21 +0000</pubDate>
      <link>https://forem.com/dav4thevid/guild-lines-to-learning-how-to-code-in-2021-ml2</link>
      <guid>https://forem.com/dav4thevid/guild-lines-to-learning-how-to-code-in-2021-ml2</guid>
      <description>&lt;p&gt;Disclaimer: &lt;em&gt;This article is subjective to my view, and it's also the guild lines I followed into becoming a better software engineer. It may work for you but I strongly believe everybody is unique, and what works for me might not work for you. So, keep this to mind while you read.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  INTRODUCTION.
&lt;/h3&gt;

&lt;p&gt;My name is David, I am a software developer who is also learning how to become a better writer. I  also enjoy teaching kids how to code. &lt;/p&gt;

&lt;p&gt;I co-founded Skill-Connect and I currently work for Bitnob (a crypto-currency company in Nigeria). I started this journey five years ago, web development precisely, Now I do both mobile development (flutter) and web (Angular/React).&lt;br&gt;
Enough of me, let's dive right in.&lt;/p&gt;

&lt;h3&gt;
  
  
  WRITE DOWN YOUR GOALS AND JUMP ON THEM.
&lt;/h3&gt;

&lt;p&gt;I believe one mistake newbies make is not setting realistic and achievable goals before jumping into any language or framework. I am also a victim of this. The reality is no one can master a language or framework 100%, you can master the ins &amp;amp; out for sure, but you can't know everything, that is impossible, even the almighty Linus Torvalds (the creator of Git/Linux) uses google to search for solutions somethings, (so I heard lol).&lt;/p&gt;

&lt;p&gt;I see many people trying so hard to grasp every concept of the tool they use, this is not just overwhelming, but this will also clutter your brain with some information you might never use. &lt;br&gt;
For example, let's say you want to learn angular, my advice would be jotting down something similar to this.&lt;/p&gt;

&lt;p&gt;i. Learn what components, directives, services are.&lt;br&gt;
ii. Learn data binding and How to make http request, intercept request with interceptors in angular.&lt;br&gt;
iii. Learn state management, Rxjs, observables etc.&lt;br&gt;
iv. Learn Authentications and Authorizations&lt;br&gt;
v. Learn Angular architectural patterns. etc.&lt;/p&gt;

&lt;p&gt;There are other things too, but the point is. Notice the above are realistic, achievable and also fundamental, I would strongly advise you build a small project after you've learnt the theoretical aspects, this helps you solidify what you've learnt and as you know getting your hands always dirty cannot be overemphasized in this industry.&lt;/p&gt;

&lt;h3&gt;
  
  
  PICK A FRAMEWORK AND STOP PROCRASTINATING.
&lt;/h3&gt;

&lt;p&gt;I was stuck on this for weeks trying to choose which framework is best for me to learn, and also there is this funny question I see many people asking now "What is the best programming language or framework to learn?". I now find this funny, because the truth is there is no best programming language.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
It's just like asking a carpenter, what is his best tool? Well, I'm no carpenter, but I'm sure the carpenter would say, every tool he uses has its own function and when it's best for him to use it. &lt;/p&gt;

&lt;p&gt;Let say a carpenter wants to divide a wood, he would use a saw, right? If he wants to join two woods together, he uses a drill and screw, or nail and hammer, right? of course he can decide to use a hammer to divide a wood, but would that be efficient. you get my point? The same principles applies to programming, every language or framework has where its scales high, and where its scales low. I think the question should be, which language is more beginner friendly? then my answer would be JavaScript or python.&lt;/p&gt;

&lt;p&gt;Also, it's very important you choose your path from onset, the reality is that Tech Industry is very huge, there is devOps, Artificial Intelligence, Machine Learning, Mobile Development, Game Development, Desktop Development, Web Development you name it. Just choose one path and learn it prerequisite, then you are good to go.&lt;/p&gt;

&lt;p&gt;For a beginner I would strongly advise you choose Web Development or Mobile Development. it's more beginner friendly, and its job opportunities are countless. You should also consider the community behind tool you are learning, Its more easy for you to find help or resources when you get stuck if the community is big.&lt;/p&gt;

&lt;h3&gt;
  
  
  LEARN DAILY AND CODE DAILY
&lt;/h3&gt;

&lt;p&gt;I hear a lot of people say, "practice makes perfect", well, I disagree. I believe practice makes you good, but obsession makes you perfect. I believe if you really want to be perfect at what you do, you need to be obsessed with what you do. Perfection is way beyond just practice.&lt;/p&gt;

&lt;p&gt;let's look at the almighty Cristiano Ronaldo for example. You see him score goals, set records that are just so crazy for anyone to beat (Some even call him immortal, lol). But the truth is, he is very hard working, Ronaldo is said to be the most hard-working football player of his time, even his teams-mates don't like paying him a visit, because he is always training when they get there, and he forces them to join him. &lt;/p&gt;

&lt;p&gt;I strongly believe he is obsessed with training. That is why we all see him as a perfect player. The same applies to all these great geniuses: Elon Musk, Michael Jordan, Linus Torvalds, etc.&lt;br&gt;
So, for you to really stand out as a developer, you have to learn daily, code daily. This forces your brain into making it a habit, and once it becomes a habit, you see yourself doing it without feeling stressed out, or forcing yourself to do it. I can guarantee you; you would scale up in no time.&lt;/p&gt;

&lt;h3&gt;
  
  
  LEARN TO ENJOY THE PROCESS
&lt;/h3&gt;

&lt;p&gt;This is my favorite, I remember how angry and frustrated I normally feel, each time I'm alone, on my bed coding, learning while my friends are out there having fun. I wasn't really progressing, I felt irritated, each time I saw an error, and my first thought would be "I'm not cut out for this". It was not until when I started tricking my brain into loving coding, that I started grasping concepts faster, solving bugs, writing good quality code.&lt;/p&gt;

&lt;p&gt;You might be wondering, &lt;br&gt;
who the heck tricks his brain? &lt;br&gt;
How? Yeah, I did just that, Here is how.&lt;/p&gt;

&lt;p&gt;I was watching YouTube one day then I came across this video by Mel Robbins, where she spoke about tricking your brain, &lt;em&gt;(the 5 seconds rule)&lt;/em&gt;, and also &lt;em&gt;How to change your life | Affirmation to success&lt;/em&gt;. I would strongly recommend you check it out here and here it's worked for me. I taught about this for some minutes and developed a routine for handling my fears and irritations.&lt;/p&gt;

&lt;p&gt;Each time I feel irritated and just want to get out and run away, I remind myself the reason I'm doing this. (mine was because I want to change my current financial status). I would imagine myself getting a good job and how happy I felt when I got things I couldn't afford now, paid my little nieces fees, how happy they were when I took them out and bought them gifts. &lt;/p&gt;

&lt;p&gt;This sends some dopamine to my brain and switches my mood, and I continue my learning process fired up.&lt;/p&gt;

&lt;p&gt;I hear lots of people saying &lt;em&gt;"don't do it because of the money"&lt;/em&gt;, well for me I don't think I would go down this route, if it wasn't for those 6 digits salaries. I personally think the same applies to over 60% of people in this industry. Just when the tech industries start booming up, suddenly, everyone on earth starts joining the industry. &lt;em&gt;(They now suddenly enjoy coding because it's fun, Naaah!!)&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Coding is very hard, like it is extremely hard, if you just started out as a beginner, you need all the motivation you can get for you to go down this route, and guess what, research has shown that money motivates man into doing the extraordinary.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
My only advice would be you shouldn't let money enforce the decision you make as a beginner. What I mean is, let's say you work for a startup, whose working environment is super nice, and your growth is paramount in this startup, and you later got an offer from a bigger startup whose pay is better, but it's toxic. don't take it. &lt;em&gt;(Run from a toxic environment as a beginner, it would drain your blood and motivation, lol)&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;I'm not saying you shouldn't take risks, of course you should do that more often, I'm just saying your growth should be more important than what you earn when starting out, because once you are above average, offers and jobs would keep coming.&lt;/p&gt;

&lt;p&gt;How would you know?&lt;/p&gt;

&lt;p&gt;Do your research thoroughly before joining any startup. It's easier for an experienced developer to switch between jobs, but it's not easy for a newbie to see jobs come their way if eventually you got fired for not being productive enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  DON'T BE SCARED OFF ERRORS AND MISTAKES
&lt;/h3&gt;

&lt;p&gt;This affected my learning process because I was battling Imposter Syndrome then. What is that? Well. &lt;/p&gt;

&lt;p&gt;Imposter Syndrome is being scared of people discovering that you are a scam. &lt;/p&gt;

&lt;p&gt;It delimits your self-confidence, and you are always scared whenever you are charged to do something new. &lt;/p&gt;

&lt;p&gt;Confidence is everything, embrace it. Whenever you see that error, don't feel irritated, try to fix it, if you can't, google is your friend. and if you still can't find any answer, then seek help from a friend, colleague or group but not after you've tried fixing it yourself, you don't want to disturb others while they are working. it makes you a lazy programmer and disvalued how you are being pictured if you keep doing that. Trust me have been down that road.&lt;/p&gt;

&lt;p&gt;Also, errors and bugs are your friend, embrace them every time because you would see a lot of them, I mean a lot. I remember how happy I felt when any code I wrote compiled at first trial when I was starting out, Now I'm usually very surprised if this happens, because I expect something to go wrong. The same applies to more experienced dev.&lt;/p&gt;

&lt;h3&gt;
  
  
  WHEN WOULD YOU BE READY TO START APPLYING FOR JOBS OR INTERNSHIPS?
&lt;/h3&gt;

&lt;p&gt;I would say you start as soon as possible, but also make sure you've built like two or more projects, your recruiter would request for your port-folio. I see many folks are always scared of applying for roles, they think they are not ready yet. Just do it, let your recruiter beside who is the perfect fit for the job, you don't have anything to lose, just continue trying, if you get rejected, try again, that's life. &lt;/p&gt;

&lt;p&gt;Just because you were rejected does not mean you are worthless or you are not a perfect fit, some recruiters don't even know what they want, I have seen a recruiter post a five years' minimum experience job for a framework that is less than 3 years (flutter precisely) and after that they choose randomly. &lt;/p&gt;

&lt;p&gt;So, you never know where luck might find you. Just try.&lt;br&gt;
Rejection is very normal, don't expect to get your first job in two to three months, its very possible though. But don't let it way you down if you've not gotten any offer yet, it would come, trust me. you have to keep trying.&lt;/p&gt;

&lt;p&gt;I remember when I was applying for internships, and I got a technical interview, I was extremely nervous, it didn't go well, thereafter my interviewer said: "You know this coding thing isn't for everybody, right?". &lt;/p&gt;

&lt;p&gt;No words of encouragement or whatsoever, I was completely devastated, I almost cried. I almost gave up, thank goodness I didn't, maybe I might be working as a fuel attendant in a gas station or a Bar attendant.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. Please I don't have anything against these jobs.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CONCLUSION
&lt;/h3&gt;

&lt;p&gt;I hope this article motivates you into being successful in your journey. Remember it's not a sprint but a marathon; coding is very hard for a beginner, but I can promise you that, it gets easier when you keep doing it. &lt;/p&gt;

&lt;p&gt;Take every step bit by bit and continue learning, you would be amazed at how far you've gone in no time. I can promise you this.&lt;/p&gt;

&lt;p&gt;Wishing you best of luck as you commence your coding journey, and don't forget, you can do it, you matter, don't let anybody tell you otherwise.&lt;br&gt;
Cheers.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codenewbie</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to implement Forgot Password/Password Reset into your Flutter Apps with Firebase Auth</title>
      <dc:creator>Fabusuyi David Oluwasegun</dc:creator>
      <pubDate>Fri, 25 Dec 2020 01:05:52 +0000</pubDate>
      <link>https://forem.com/dav4thevid/how-to-implement-forgot-password-password-reset-into-your-flutter-apps-with-firebase-auth-3jjd</link>
      <guid>https://forem.com/dav4thevid/how-to-implement-forgot-password-password-reset-into-your-flutter-apps-with-firebase-auth-3jjd</guid>
      <description>&lt;h2&gt;
  
  
  This is final series of our &lt;strong&gt;Step by Step Guide on How to Authenticate your Flutter App with Firebase Auth&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You can check out the previous post &lt;a href="https://dev.to/dav4thevid/set-by-set-guild-on-how-authenticate-your-flutter-app-with-firebase-auth-3lb4"&gt;here&lt;/a&gt; and &lt;a href="https://dev.to/dav4thevid/how-to-add-firebase-email-verification-to-your-flutter-app-4cbi"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Adding Forgot password/Password functionality is very essential in every app, and with firebase_auth we already have all that done for us, all we have to do is call the method, pass the right arguments, then we are good to go. &lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;If you already familiar with how firebase works, feel free clone the complete project we would be building &lt;a href="https://github.com/dav4thevid/flutter_firebase_authentication_part3"&gt;here&lt;/a&gt;&lt;br&gt;
If you are a firebase beginner, I would highly recommend you code along. Let dive right in&lt;/p&gt;
&lt;h2&gt;
  
  
  FORGOT PASSWORD
&lt;/h2&gt;

&lt;p&gt;Let’s start by creating our &lt;code&gt;Forgot Password Screen&lt;/code&gt;, open Screens folder and add a new file, name it &lt;code&gt;ForgotPassword.dart&lt;/code&gt;. import material library and add the code below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ForgotPassword extends StatelessWidget {
  static String id = 'forgot-password';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.lightBlueAccent,
      body: Form(
        child: Padding(
          padding: EdgeInsets.symmetric(horizontal: 30.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                'Email Your Email',
                style: TextStyle(fontSize: 30, color: Colors.white),
              ),
              TextFormField(

                    style: TextStyle(color: Colors.white),
                    decoration: InputDecoration(
                      labelText: 'Email',
                      icon: Icon(
                        Icons.mail,
                        color: Colors.white,
                      ),
                      errorStyle: TextStyle(color: Colors.white),
                      labelStyle: TextStyle(color: Colors.white),
                      hintStyle: TextStyle(color: Colors.white),
                      focusedBorder: UnderlineInputBorder(
                        borderSide: BorderSide(color: Colors.white),
                      ),
                      enabledBorder: UnderlineInputBorder(
                        borderSide: BorderSide(color: Colors.white),
                      ),
                      errorBorder: UnderlineInputBorder(
                        borderSide: BorderSide(color: Colors.white),
                      ),
                    ),
                  ),
              SizedBox(height: 20),
              RaisedButton(
                child: Text('Send Email'),
                onPressed: () {},
              ),
              FlatButton(
                child: Text('Sign In'),
                onPressed: () {},
              )
            ],
          ),
        ),
      ),
    );
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s just a basic UI, I won’t walk through that. Now let’s create our Forgot Password route, open &lt;code&gt;main.dart&lt;/code&gt; and add this code inside our routes, &lt;code&gt;ForgotPassword.id: (context) =&amp;gt; ForgotPassword(),&lt;/code&gt;.&lt;br&gt;
We also have to create a forgot password &lt;code&gt;FlatButton&lt;/code&gt; inside our SignIn class, and make it navigate to our newly created route.&lt;/p&gt;

&lt;p&gt;Open SignIn Class add this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FlatButton(
     onPressed: () {
     Navigator.pushNamed(
     context,
     ForgotPassword.id,
 );
},
 child: Text(
'Forgot Password?',
  style: TextStyle(color: Colors.grey, fontSize: 12),
   ),
),

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is doing nothing fancy, it’s just takes our newly created &lt;code&gt;route id&lt;/code&gt; then it passes that into &lt;code&gt;Navigator.pushNamed&lt;/code&gt;, and this would trigger navigation when the user presses this &lt;code&gt;FlatButton&lt;/code&gt;. Hot restart your app and test. forgot password should now take you to the Forgot Password screen.&lt;/p&gt;

&lt;p&gt;Now that we have successfully added the UI and navigation for &lt;code&gt;ForgotPassword&lt;/code&gt;, lets implement the functionality.&lt;/p&gt;

&lt;p&gt;Create a new method, name it &lt;code&gt;passwordReset&lt;/code&gt;, then we have to create an instance of firebase_auth, so we would be able to use its functions. import &lt;code&gt;import 'package:firebase_auth/firebase_auth.dart';&lt;/code&gt; like so, and create an instance of it with &lt;code&gt;final _auth = FirebaseAuth.instance;&lt;/code&gt; inside &lt;code&gt;passwordReset&lt;/code&gt; method. We now have an instance of firebase_auth with &lt;code&gt;_auth&lt;/code&gt; (i.e., any instance, variable or function with underscore, makes its private, that means we can't call it outside this class). Now add this line &lt;code&gt;await _auth.sendPasswordResetEmail();&lt;/code&gt;This takes an email as an argument. Create an email String above and pass it inside &lt;code&gt;sendPasswordResetEmail' like this&lt;/code&gt;await _auth.sendPasswordResetEmail(email: _email);`&lt;/p&gt;

&lt;p&gt;We also need to prevent our code from moving to the next like when the auth request is not completed. Its an asynchronous call, we don't know how long it would take. if you are not familiar with asynchronous programming, you can check here for reference &lt;a href="https://dart.dev/codelabs/async-await"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/a&gt;. Add await to the instance and async to &lt;code&gt;passwordReset&lt;/code&gt; method. (whew, we almost there). Now wrap your password reset method with try and catch block, should in case the request wasn't successful, it would throw an exception, so your app doesn't break. Lastly add this line.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
 Navigator.push(&lt;br&gt;
        context,&lt;br&gt;
        MaterialPageRoute(builder: (context) {&lt;br&gt;
          return ConfirmEmail();&lt;br&gt;
        }),&lt;br&gt;
   );&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would navigate us to our Confirm Email Screen on completion. (i.e. We created this in the previous article). Our password reset method should now look like this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
Future _passwordReset(String email) async {&lt;br&gt;
    try {&lt;br&gt;
      await _auth.sendPasswordResetEmail(email: email);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Navigator.push(
      context,
      MaterialPageRoute(builder: (context) {
        return ConfirmEmail(

        );
      }
    ),
  );
} catch (e) {
  print(e);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Notice!!!, We have an error with the context, right? That is because our Class is a stateless widget, convert it into stateful widget by clicking on our &lt;code&gt;ForgotPassword&lt;/code&gt;  class and press &lt;code&gt;ctrl + .&lt;/code&gt;. &lt;br&gt;
Another way of fixing this is by calling our password reset method as a callback inside our &lt;code&gt;RaisedButton&lt;/code&gt; with the &lt;code&gt;onPressed&lt;/code&gt; property. Either way works, I would go with this (I don't like cluttering my UI with logic).&lt;/p&gt;

&lt;p&gt;Now add &lt;code&gt;onSaved&lt;/code&gt; method inside the &lt;code&gt;TextFormField&lt;/code&gt;, add newEmail as its argument, then assign our &lt;code&gt;_email&lt;/code&gt; variable to &lt;code&gt;newEmail&lt;/code&gt; like is &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
 onSaved: (newEmail) {&lt;br&gt;
      _email = newEmail;&lt;br&gt;
   },&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
 Now call our &lt;code&gt;passwordReset&lt;/code&gt; inside the &lt;code&gt;onPressed&lt;/code&gt; property and pass our email variable like this. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
onPressed: () {&lt;br&gt;
                  _passwordReset();&lt;br&gt;
                  print(_email);&lt;br&gt;
 },&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since we are using a &lt;code&gt;TextformField&lt;/code&gt; widget as out input field, we need to wrap our entire field into a form widget and pass its key, If we don't do that our &lt;code&gt;TextFormField&lt;/code&gt; would return null, because it’s doesn't know the current state of our form. We need to track the current state of our form. wrap the entire Column widget with a form widget. Form widget has a property &lt;code&gt;key&lt;/code&gt; add that with a &lt;code&gt;_formKey&lt;/code&gt; like this &lt;code&gt;key: _formKey&lt;/code&gt;. create a new variable &lt;code&gt;formKey&lt;/code&gt; below our email string variable like this. &lt;code&gt;final _formKey = GlobalKey&amp;lt;FormState&amp;gt;();&lt;/code&gt;. Now inside our &lt;code&gt;passwordReset&lt;/code&gt;, above sendPasswordReset function, add this this line. &lt;code&gt;_formKey.currentState.save();&lt;/code&gt; This would save the current state of our form and send the inputted values upon submission. Your passwordReset should look like this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
_passwordReset() async {&lt;br&gt;
    try {&lt;br&gt;
       _formKey.currentState.save();&lt;br&gt;
      await _auth.sendPasswordResetEmail(email: _email);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Navigator.push(
    context,
    MaterialPageRoute(builder: (context) {
      return ConfirmEmail();
    }),
  );
} catch (e) {
  print(e);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run Hot restart and test your app. This should send a mail link to the provided email for resetting password and also navigate you to the confirm email screen.&lt;/p&gt;

&lt;p&gt;(Note: remember you have to be registered before you can reset your password, since we are not handling errors, its won't prompt you or send you email if you are not registered, but you can check your terminal for invalid emails errors and so on). &lt;/p&gt;

&lt;p&gt;Lastly, Notice our confirm email screen reads &lt;code&gt;"'An email has just been sent to you, Click the link provided to complete registration'"&lt;/code&gt;. That is not text we won't for password, lets make &lt;code&gt;ConfirmEmail&lt;/code&gt; text dynamic. (i.e another way of fixing this is by creating a separate screen for this).&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;ConfirmEmail&lt;/code&gt;add a new variable below id &lt;code&gt;String message&lt;/code&gt;, add it inside the &lt;code&gt;constructor&lt;/code&gt; then cut the message text and pass the message inside our Text widget.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
child: Text(&lt;br&gt;
    message,    //here&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Now open &lt;code&gt;ForgotPassword&lt;/code&gt;, create a new variable message, add the text you cut into this variable, then pass it inside our &lt;code&gt;ConfirmEmail&lt;/code&gt;. Your routing should look like this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
 Navigator.push(&lt;br&gt;
        context,&lt;br&gt;
        MaterialPageRoute(builder: (context) {&lt;br&gt;
          return ConfirmEmail(message: widget.message,);&lt;br&gt;
        }),&lt;br&gt;
      );&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do the same for our &lt;code&gt;SignUp&lt;/code&gt; Screen.&lt;/p&gt;

&lt;p&gt;We have finally completed this series. I might be writing another post for error handling and form validations, if you want that, feel free to comment below. If you have any question, feel free to ask them also. you can correct me if you spot any errors or typos.&lt;/p&gt;

&lt;p&gt;Thank you for taking your time to read this.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>programming</category>
      <category>mobile</category>
    </item>
    <item>
      <title>How to add Firebase Email Verification to your Flutter App </title>
      <dc:creator>Fabusuyi David Oluwasegun</dc:creator>
      <pubDate>Tue, 22 Dec 2020 23:58:19 +0000</pubDate>
      <link>https://forem.com/dav4thevid/how-to-add-firebase-email-verification-to-your-flutter-app-4cbi</link>
      <guid>https://forem.com/dav4thevid/how-to-add-firebase-email-verification-to-your-flutter-app-4cbi</guid>
      <description>&lt;p&gt;This article is a continuation of my previous article &lt;strong&gt;(Step by Step guide on how to authenticate your flutter app with Firebase (PART 1))&lt;/strong&gt;. If you want to code along, I would recommend you read it &lt;a href="https://dev.to/dav4thevid/set-by-set-guild-on-how-authenticate-your-flutter-app-with-firebase-auth-3lb4"&gt;here&lt;/a&gt; or clone the repo &lt;a href="https://github.com/dav4thevid/flutter_firebase_authentication"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In our previous app, a user can sign up with an email that doesn't exist (You don't want that in your live app). Lets add email verification to our app, so as to prevent users from entering invalid emails.&lt;/p&gt;

&lt;h2&gt;
  
  
  EMAIL VERIFICATION
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;SignUp.dart&lt;/code&gt; file, Our signup method is inside the &lt;code&gt;RaisedButton&lt;/code&gt;, lets extract that into a separate method, instead of using a callback we would call the method instead. create a new method and name it &lt;code&gt;signUp&lt;/code&gt;, copy the extracted code into it. You would notice we have an error, the &lt;code&gt;context&lt;/code&gt; inside our routing right?. This is because our class is a stateless widget and since we have extracted our logic from our UI, its can't get the current context, we can solve this easily by making our class a statefull widget. click on the signUp class then hold &lt;code&gt;ctrl + .&lt;/code&gt;, then click on convert to stateful widget. (There you go). Now call your method inside the onPressed property of RaisedButton. Your SignUp method should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Future signUp() async {
    _formKey.currentState.save();
    try {
      final new_user = await _auth.createUserWithEmailAndPassword(
          email: _email, password: _password);
      if (new_user != null) {
        Navigator.pushNamed(context, HomepageScreen.id);
      }
    } catch (e) {
      print(e);
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your RaisedButton should now look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RaisedButton(
       onPressed: signUp,
       child: Text(
      'Submit',
       style: TextStyle(fontSize: 18),
   ),
),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You see our code now looks cleaner. Inside our signUp function, underneath &lt;code&gt;CreateUserWithEmailAndPassword&lt;/code&gt; function add this code &lt;code&gt;await newUser.user.sendEmailVerification()&lt;/code&gt;. This function would trigger firebase to send a confirmation email to the user upon signup, all this are done under the hood, easy right? lolx. lets move on.&lt;/p&gt;

&lt;p&gt;We need to prevent users from signing in, if they haven't verified their email. We also have to navigate them to Confirm Email Screen instead of the Homepage, So they don't have access to our app until they are verified. Now open the SignIn Class, extract the signin method like we did above, or if you like leave it like that. Instead of checking if user exist, we would be checking if the user is verified. delete &lt;code&gt;if (user != null)'&lt;/code&gt; replace with &lt;code&gt;if (user.user.emailVerified)&lt;/code&gt;. Now lets create our Confirm Email Screen. Create a new file and name it &lt;code&gt;ConfirmEmail&lt;/code&gt; then add this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
static String id = 'confirm-email';

class ConfirmEmail extends StatelessWidget {
  const ConfirmEmail({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
          child: Text(
        'An email has just been sent to you, Click the link provided to complete registration',
        style: TextStyle(color: Colors.white, fontSize: 16),
      )),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its just a basic screen no styling or whatsoever, lolx. Moving On, We have to add our ConfirmEmail route, open &lt;code&gt;main.dart&lt;/code&gt; underneath our routes add this &lt;code&gt;ConfirmEmail.id: (context) =&amp;gt; ConfirmEmail(),&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now go back to your signin method and change &lt;code&gt;HomepageScreen.id&lt;/code&gt; to &lt;code&gt;ConfirmEmail.id&lt;/code&gt;. Your SignIn method should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Future signIn() async {
    _formKey.currentState.save();
    try {
      final user = await _auth.signInWithEmailAndPassword(
          email: _email, password: _password);
      if (user.user.emailVerified) {
        Navigator.pushNamed(context, ConfirmEmail.id);
      }
    } catch (e) {
      print(e);
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart your app and test, A confirmation email should be sent to you after registration, Try signing In before confirmation to check if the verification is working, All this should work fine if you follow along correctly.&lt;/p&gt;

&lt;p&gt;Feel free to check my future articles where I would walk you through on &lt;em&gt;How to add Forget Password and Reset Password&lt;/em&gt; to your Flutter Apps. Thanks for reading, I hope its helps.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>programming</category>
      <category>mobile</category>
      <category>dart</category>
    </item>
    <item>
      <title>Step By Step Guide On How to Authenticate your Flutter App with FireBase Auth</title>
      <dc:creator>Fabusuyi David Oluwasegun</dc:creator>
      <pubDate>Thu, 17 Dec 2020 01:49:20 +0000</pubDate>
      <link>https://forem.com/dav4thevid/set-by-set-guild-on-how-authenticate-your-flutter-app-with-firebase-auth-3lb4</link>
      <guid>https://forem.com/dav4thevid/set-by-set-guild-on-how-authenticate-your-flutter-app-with-firebase-auth-3lb4</guid>
      <description>&lt;p&gt;In this post, I will be walking you through how to authenticate your flutter app with firebase. we won't be building anything fancy. just a demo app with three screens (Sign-Up, Sign-In and Homepage). This post assumes you've already setup your IDE with Flutter, we won't do that here, if you ready, Lets dive right in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TLDR&lt;/strong&gt;&lt;br&gt;
If you already familiar with Flutter and Firebase and this post is too long for you to read, you can download the final project we would be building &lt;a href="https://github.com/dav4thevid/flutter_firebase_authentication" rel="noopener noreferrer"&gt;here on github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are not fully familiar with Flutter and Firebase, I would highly recommend you read through or better still code along so as to fully understand how things work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Firstly let create our Flutter App.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;if you are using VSCode, Open the Command Palette &lt;strong&gt;( Ctrl + Shift + P) for windows&lt;/strong&gt; and &lt;strong&gt;( Cmd + Shift + P)&lt;/strong&gt; for mac. click on New Project and feel free give the project any name you want. (Note: all letters has to be lower case). If you are using Android Studio as your IDE. click on file, then navigate to new flutter project. select flutter application then name the project and choose any folder path you want your project to be saved in. set package name is your app domain name, if you don't have that feel free to add this &lt;strong&gt;(com.example.yourappname)&lt;/strong&gt; P.S: Write this down, we would be need it when we are ready to initialize our app with firebase, also Don't forget to tick all boxes then click finish.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lets start creating our screens.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Note: I would be using &lt;code&gt;VSCode&lt;/code&gt; for this article, if you're using Android Studio you can click the play button to run your app.)&lt;br&gt;
open your terminal then navigate to your newly created flutter project then run your app with &lt;code&gt;flutter run&lt;/code&gt;. open &lt;code&gt;lib/main.dart&lt;/code&gt; file and delete &lt;code&gt;MyHomePage&lt;/code&gt; class, we would be creating ours shortly. Create a new folder, I will name mine screens. Now click on new file and name the file &lt;code&gt;SignUp.dart&lt;/code&gt;, do same for &lt;code&gt;SignIn.dart&lt;/code&gt; and &lt;code&gt;Homepage.dart&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;Open our newly created SignUp.dart file import material Design with &lt;code&gt;import 'package:flutter/material.dart'&lt;/code&gt; then create your signup class (Stateless Widget), you can do that by just typing &lt;code&gt;stl&lt;/code&gt; an auto create would popup, just click it (there you go 😉). Name it signup class, lets make the class return a text widget with "Sign Up" text temporarily, while we create our routes. Your SignUp class should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';

class SignUpScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text('Sign Up'),
    );
  }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;feel free to do the same for SignIn and Homepage files.&lt;/p&gt;

&lt;p&gt;Open the main.dart file, you would notice the myHomePage class we deleted is already prompting us of an error, delete the entire line. we would be creating ours shortly. Now add this &lt;code&gt;initialRoute: SignUp.id&lt;/code&gt;.&lt;br&gt;
Note: we could use any of this Material App properties (&lt;code&gt;home&lt;/code&gt; or &lt;code&gt;initialRoute&lt;/code&gt;) as our base route, but I prefer using initial route so as to make the naming convention the same, its doesn't really matter in our case, you could use either of the two.&lt;br&gt;
PS: &lt;code&gt;home&lt;/code&gt; takes a widget as its property, while &lt;code&gt;initialRoute&lt;/code&gt; takes a string. Notice that its prompt an error, that is because we have not added the route to our SignUp class. Open SignUp and add this line &lt;code&gt;static String id = 'sign-up';&lt;/code&gt;, Do the same for both SignInScreen and HomepageScreen.&lt;/p&gt;

&lt;p&gt;We've added our initial route, Our app would navigate to signup screen upon launch. Now lets create our &lt;code&gt;routes&lt;/code&gt;, this takes Map  as argument. now add this lines &lt;code&gt;SignUpScreen.id: (context) =&amp;gt; SignUpScreen(),&lt;/code&gt; Do same for both SignIn and Homepage route.&lt;br&gt;
Your code should now look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:flutter_practice/Screens/Homepage.dart';
import 'package:flutter_practice/Screens/SignIn.dart';
import 'package:flutter_practice/Screens/SignUp.dart';


void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      // home: SignUpScreen(),
      initialRoute: SignUpScreen.id,
      routes: {
        SignUpScreen.id: (context) =&amp;gt; SignUpScreen(),
        SignInScreen.id: (context) =&amp;gt; SignInScreen(),
        HomepageScreen.id: (context) =&amp;gt; HomepageScreen(),
      },
    );
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now hot restart you your app with &lt;code&gt;capslock R&lt;/code&gt;. You should see a black screen with a huge 'Sign Up' red text, (😞 Our screen is ugly, lets style it up a little). Im not going to walk through the styling process just copy and paste the below code, if you are following along.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';

class SignUpScreen extends StatelessWidget {
  static String id = 'sign-up';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.lightBlueAccent,
      body: Container(
        child: Center(
          child: Padding(
            padding: const EdgeInsets.all(50.0),
            child:
                Column(mainAxisAlignment: MainAxisAlignment.center, children: [
              Text(
                'Sign Up Here',
                style: TextStyle(fontSize: 30, color: Colors.white),
              ),
              SizedBox(
                height: 20,
              ),
              TextFormField(
                obscureText: true,
                style: TextStyle(color: Colors.white),
                decoration: InputDecoration(
                  labelText: 'Email',
                  icon: Icon(
                    Icons.mail,
                    color: Colors.white,
                  ),
                  errorStyle: TextStyle(color: Colors.white),
                  labelStyle: TextStyle(color: Colors.white),
                  hintStyle: TextStyle(color: Colors.white),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                  errorBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                ),
              ),
              TextFormField(
                style: TextStyle(color: Colors.white),
                decoration: InputDecoration(
                  labelText: 'Password',
                  icon: Icon(
                    Icons.lock,
                    color: Colors.white,
                  ),
                  errorStyle: TextStyle(color: Colors.white),
                  labelStyle: TextStyle(color: Colors.white),
                  hintStyle: TextStyle(color: Colors.white),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                  errorBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.white),
                  ),
                ),
              ),
              RaisedButton(
                onPressed: () {},
                child: Text(
                  'Submit',
                  style: TextStyle(fontSize: 18),
                ),
              )
            ]),
          ),
        ),
      ),
    );
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can replicate that for the Signin screen as well, but if you like, feel free to style it to your own taste. We now have our auth screens styled up, we can now initialize our app with Firebase. Our SignUp Screen should look like this &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fibb.co%2FgT9zpsb" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fibb.co%2FgT9zpsb" alt="Sign up screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initializing App to Firebase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;visit the firbase console &lt;a href="https://console.firebase.google.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
P.S: You need to have a google account, SignUp if you don't have one.&lt;br&gt;
click on Add Project, enter the project name, then create new project, this should take less than 20seconds.( We would be building for Android on this post). incase you forgot your package name, open android/app/build.gradle scroll downwards you would see &lt;code&gt;applicationId&lt;/code&gt; thats you package name, Now click continue and download your &lt;code&gt;google.services.json&lt;/code&gt; file.&lt;br&gt;
P.S: Make sure to click the download button just once, so as to prevent duplicate files been downloaded, if you've download this particular file before, delete it from your downloads folder. Now move the &lt;code&gt;google.services.json&lt;/code&gt; file you just downloaded into &lt;code&gt;android/app&lt;/code&gt; root folder. make sure its the right folder, if not its might prevent our app from running. &lt;/p&gt;

&lt;p&gt;Once you've done click on next then open &lt;code&gt;android/build.gradle&lt;/code&gt; and add this line under dependencies &lt;code&gt;classpath 'com.google.gms:google-services:4.3.4'&lt;/code&gt; and this &lt;code&gt;google()&lt;/code&gt; under all project repositories if its not already added. Now open android/app/build.gradle. and add this line &lt;code&gt;apply plugin: 'com.google.gms.google-services'&lt;/code&gt; under app plugin then this &lt;code&gt;implementation 'com.google.firebase:firebase-analytics'&lt;/code&gt; under dependencies. (😫phew!! we are almost there).&lt;/p&gt;

&lt;p&gt;We need to install some Firebase packages into our app namely &lt;code&gt;firebase_auth&lt;/code&gt; and &lt;code&gt;firebase_core&lt;/code&gt;. open &lt;code&gt;pubspect.yaml&lt;/code&gt; file and add this lines &lt;code&gt;firebase_auth: ^0.18.0+1&lt;/code&gt; and &lt;code&gt;firebase_core: ^0.5.0&lt;/code&gt;, make sure its properly aligned (pubspect.yaml could be funny at times, lolx).Once you've done that, click on &lt;code&gt;Get Packages&lt;/code&gt; this should install these packages into our app.&lt;/p&gt;

&lt;p&gt;Now open &lt;code&gt;main.dart&lt;/code&gt; file and add this lines.&lt;br&gt;
&lt;code&gt;WidgetsFlutterBinding.ensureInitialized();&lt;/code&gt;&lt;br&gt;
  and &lt;code&gt;await Firebase.initializeApp();&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;main.dart&lt;/code&gt; file should now look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void main() async{
   WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;P.S: don't forget to import &lt;code&gt;package:firebase_core/firebase_core.dart;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Close and rerun your app on the terminal, &lt;code&gt;ctrl c&lt;/code&gt; and &lt;code&gt;flutter run&lt;/code&gt;. If your app runs successfully, Congratulations!!! you have successfully initialized your flutter app with firebase.&lt;/p&gt;

&lt;p&gt;if you encounter build errors.  &lt;a href="https://github.com/flutter/flutter/issues/38934" rel="noopener noreferrer"&gt; click here for fix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now that we've successfully created our screens and initialized our app with flutter, its time we start writing our authentication logic.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authenticating our App with Flutter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open the SignUp file, since we using &lt;code&gt;TextFormField&lt;/code&gt; we would have to wrap our entire column into a &lt;code&gt;form&lt;/code&gt; widget. click the column widget and also click the yellow lightbulb that shows at the left side, select wrap with widget, then rename widget to &lt;code&gt;Form&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Form has a property called key add this &lt;code&gt;key: _formKey&lt;/code&gt;. This creates a container for form fields and make us get the form values upon save. We would have to create an instance for GlobalKey, which is the _formKey we added. add this line below our static id String &lt;code&gt;final _formKey = GlobalKey&amp;lt;FormState&amp;gt;();&lt;/code&gt;. Now create create email, password variable. &lt;code&gt;String _email;&lt;/code&gt; &lt;code&gt;String _password;&lt;/code&gt;. We now have to add a call back inside our &lt;code&gt;TextFormField&lt;/code&gt; to bind our email and password variable inside our callback. Add this line inside our &lt;code&gt;TextFormField&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onSaved: (emailValue) {
    _email = emailValue;
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 Do same for password TextFormField. Now lets test and see if our binding works correctly. Inside our &lt;code&gt;RaisedButton&lt;/code&gt; add this line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; onPressed: () {
     _formKey.currentState.save();
     print(_email);
     print(_password);
   },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type in a dummy email and password inside the text field and click submit, you should see the text you typed inside your terminal. Lets move on.&lt;/p&gt;

&lt;p&gt;Now add this line inside the onPressed callback&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onPressed: () async {
      _formKey.currentState.save();
      try {
    final new_user = await _auth.createUserWithEmailAndPassword(
    email: _email, password: _password);
    if (new_user != null) {
    Navigator.pushNamed(context, HomepageScreen.id);
             }
      } catch (e) {
         print(e);
       }
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code takes our &lt;code&gt;_auth&lt;/code&gt; instance from firebase and pass our email and password values into the &lt;code&gt;createUserWithEmailAndPassword&lt;/code&gt; function from firebase. its also check if user is not available, if so its navigate us to the homescreen page. if there is an error, its catches the error and print it on the terminal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We have to enable email and password authentication from firebase console&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now visit the firebase console &lt;a href="https://console.firebase.google.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt; then click on your project, on the left, click on authentication, click on sign in methods, You can see Email/Password is disabled. enable it and save.&lt;/p&gt;

&lt;p&gt;Before we test, lets go to our Homepage screen and add some contents to it, so its doesn't show a complete blank screen. Inside the Homepage screen, delete the entire class and add this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
class HomepageScreen extends StatelessWidget {
  static String id = 'homepage';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: null,
        actions: &amp;lt;Widget&amp;gt;[
          IconButton(
              icon: Icon(Icons.close),
              onPressed: () {
              }),
        ],
        title: Text(
          'Homepage',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Colors.lightBlueAccent,
      ),
      body: Center(child: Text('Homepage'),),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open terminal and run hot restart. Now test sign up, its should sign the user up and navigate to Homepage Screen. You can click on users on firebase console, to see the list of registered users. &lt;br&gt;
P.S: When testing make sure your password is 6 characters or above, firebase won't accept anything lower than that.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Lets implement &lt;code&gt;signOut&lt;/code&gt; on our app.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Inside the method in our &lt;code&gt;IconButton&lt;/code&gt; widget, add this &lt;br&gt;
              &lt;code&gt;_auth.signOut();&lt;br&gt;
               Navigator.pop(context);&lt;/code&gt;. also import firebase auth &lt;code&gt;import 'package:firebase_auth/firebase_auth.dart';&lt;/code&gt; and create its instance like so &lt;code&gt;final _auth = FirebaseAuth.instance;&lt;/code&gt; . Your Homepage screen should now look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';

class HomepageScreen extends StatelessWidget {
  static String id = 'homepage';
  final _auth = FirebaseAuth.instance;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: null,
        actions: &amp;lt;Widget&amp;gt;[
          IconButton(
              icon: Icon(Icons.close),
              onPressed: () {
                // Implement logout functionality
                _auth.signOut();
                Navigator.pop(context);
              }),
        ],
        title: Text(
          'Homepage',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Colors.lightBlueAccent,
      ),
      body: Center(child: Text('Homepage')),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run hot reload &lt;code&gt;r&lt;/code&gt; and test the log out functionality. its should take you back to the SignUp Screen. We are almost there, &lt;em&gt;lets implement the SignIn functionality&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Underneath the &lt;code&gt;RaisedButton&lt;/code&gt; create a FlatButton and give it Text widget like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FlatButton(
    onPressed: () {
    Navigator.pushNamed(context, SignInScreen.id);
},
     child: Text('Sign In'),
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;navigator.pushNamed&lt;/code&gt; line would make our app navigate to the &lt;code&gt;Sign In Screen&lt;/code&gt;. Now test and see if its working.&lt;/p&gt;

&lt;p&gt;Open the SignIn Screen and wrap the &lt;code&gt;column&lt;/code&gt; widget with a form widget add the key property also. Create an email and password variable like we did when implementing the Sign Up functionality, I wont walk through that again, you can check the SignUp Screen or scroll up for reference.&lt;/p&gt;

&lt;p&gt;Inside the onPressed callback in our &lt;code&gt;RaisedButton&lt;/code&gt; add this line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  onPressed: () async{
_formKey.currentState.save();
   try {
      final user = await _auth.signInWithEmailAndPassword(
      email: _email, password: _password);
      if (user != null) {
      Navigator.pushNamed(context, HomepageScreen.id);
       }

       } catch (e) {
        print(e);
      }
   },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should navigate you into HomepageScreen, if you entered your correct credentials. (phew 😌! Finally, haha). We have successfully authentication our app with firebase auth. Congratulations!!!. &lt;/p&gt;

&lt;p&gt;Feel free to correct me if you spot any errors, you can also checkout my future posts where I would be walking you through how to add forget password, reset password with firebase. &lt;/p&gt;

&lt;p&gt;Your feedbacks and comments would be greatly appreciated. Thanks for your time.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>programming</category>
      <category>dart</category>
    </item>
  </channel>
</rss>
