Create a flutter authenticate app in 10 mins by using firebase as the back-end. This Flutter tutorial is for beginners to build an app step by step with Firebase authenticate feature.
If you haven’t set up your environment, please go to Flutter & Firebase App Tutorial — Part 1 Get Started.
More Tutorials:
- Flutter & Firebase App Tutorial — Part 1 Get Started
- Flutter & Firebase App Tutorial — Part 2 App Structure
- Flutter & Firebase App Tutorial — Part 3 Firebase Sign In Anonymously
- Flutter & Firebase App Tutorial — Part 4 Custom model in Flutter App
- Flutter & Firebase App Tutorial — Part 5 Stream & Provider in Flutter
- Flutter & Firebase App Tutorial — Part 6 Firebase Sign Out
- Flutter & Firebase App Tutorial — Part 7 Firebase Sign In and Register With Email
- Flutter & Firebase App Tutorial — Part 8 toggle between forms and form validation
- Flutter & Firebase App Tutorial — Part 9 loading Spinkit and theme & layout
Table of Contents
- Create folder structure
- Create widgets
These are the folders and files that we are about to create:
Step 1: Create folders to better structure the codes
Create a few folders inside the lib folder so that we can organize codes efficiently.
Step 1.1 👉 screens folder: all the widgets that make up the different screens are inside this folder.
Step 1.2 Create subfolders for different sections of your app.
➡️ home: a sub-folder of screens folder. All the different widgets that create the home screen will live in this folder.
➡️ authenticate: a sub-folder of screens folder. All the different widgets that create the authenticate screen will live inside this folder.
Step 2: Create widgets
Step 2.1 Create a new file called “authenticate.dart” inside the authenticate folder. It will be the root authenticate widget and shows either the “Sign in” widget or the “Sign Up” widget.
Step 2.1 Create a stateless widget called “Home” inside the home folder. It’s the widget that wraps the list widget
Step 2.2 Create a stateful widget called “Authenticate”. We will use State in the future inside this widget. Do the same for
➡️SignIn
➡️SignUp
type in stless and then tab to create a stateless widget
Step 2.3 Create a stateless widget called “Wrapper” to return either Home or Authenticate widget
Step 3: Show Wrapper widget in the main.dart
Remove everything inside the MaterialApp and then the home property will be the Wrapper widget.
Next, we are gonna introduce Firebase Auth into the app.
More Tutorials:
- Flutter & Firebase App Tutorial — Part 1 Get Started
- Flutter & Firebase App Tutorial — Part 2 App Structure
- Flutter & Firebase App Tutorial — Part 3 Firebase Sign In Anonymously
- Flutter & Firebase App Tutorial — Part 4 Custom model in Flutter App
- Flutter & Firebase App Tutorial — Part 5 Stream & Provider in Flutter
- Flutter & Firebase App Tutorial — Part 6 Firebase Sign Out
- Flutter & Firebase App Tutorial — Part 7 Firebase Sign In and Register With Email
- Flutter & Firebase App Tutorial — Part 8 toggle between forms and form validation
- Flutter & Firebase App Tutorial — Part 9 loading Spinkit and theme & layout
Seeing my followers grow will encourage me to write more articles. If you have any questions or anything to be improved please write a comment in the comments section.
I am a Flutter lover, and I talk about flutter, mobile development, and artificial intelligence.
👉 The source code is updated in Github