Along with adding phone authentication, this tutorial will add sign in with Google to make the experience seamless with Firebase and such.

I’ll be explaining what my code does instead of making you write what I already wrote, so it’ll be easier for both of us. Be mindful and instead of copying and pasting everything from my code, try to read here about what it does and how. Also, type it! It’ll be better for your memory.

You can start by cloning my repo, which won't work if you just run it because there's a few configuration steps you need to follow below! You can also do this for your own project and just use my implementation as a starting point!

Don't forget to run flutter packages get or the equivalent for your IDE!

Then, we're heading to Firebase's console to create a new project! You should see a screen like this one on the side.

After creating it and waiting a few seconds, we should now be on the dashboard.

We're heading to Authentication to make a few changes on Sign-in method. Just click on Phone, then enable and save. Same thing for Google, then enable and save. Your Sign-in method tab should look like this:

We are not done yet! Fortunately, Google already made a Codelab that ensures you add platform-specific configuration to your Firebase app. Just click here and come back once you're done with this step. Remember, only Step 6 and 7 are necessary for this.

Also, if you're doing this on iOS, don't forget to do the steps on iOS integration here, changing the Google Sign-in Section within ios/Runner/Info.plist with the correct CFBundleURLSchemes data.