Flutter Firebase Authentication Tutorial - Firebase Auth using email and password 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • In this flutter tutorial, we will learn flutter firebase authentication using email and password.
    COMPLETE PLAYLIST: • Flutter Login App - UI...
    We will use GETX State Management to keep the code clean and use the cleanest way to perform firebase authentication.
    We will learn to Create user with email and password, Sign In user with email and password, logout the user, keep the firebase user logged in even app close, keep the separation of concern with a separate Authentication repository controller and Signup, login controller with the backend logic.
    LOGIN APP PLAYLISTS
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ► COMPLETE PLAYLIST: • Flutter Login App - UI...
    ► FIREBASE PLAYLIST: • Flutter Firebase Basic...
    DOWNLOAD PROJECT
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ► CODE & RESOURCES: codingwitht.com/flutter-login...
    VIDEOS
    ▬▬▬▬▬▬▬▬▬▬ DESIGN ▬▬▬▬▬▬▬▬▬▬
    ► 01 - Flutter Folder Structure • Flutter App with Fireb...
    ► 02 - Flutter Folder Structure • How to Create a Flutte...
    ► 03 - Setup Theme Light & Dark: • How to Setup a Custom ...
    ► 04 - Flutter Native Splash • How to create Flutter ...
    ► 05 - Custom Splash with Animation • Flutter Splash Screen ...
    ► 06 - On Boarding Screen • Flutter Onboarding Scr...
    ► 07 - Welcome Screen Design • Welcome Screen | Flutt...
    ► 08 - Animate any widget • Flutter Animation 2023...
    ► 09 - Flutter Login UI • Flutter Animation 2023...
    ► 10 - Flutter Signup UI • Modern Signup form in ...
    ► 11 - Flutter Forget Screen • Flutter Forget Passwor...
    ► 12 - Flutter OTP Design • Flutter OTP Verificati...
    ► 13 - Flutter Dashboard • Flutter UI Design Tuto...
    ▬▬▬▬▬▬▬▬▬▬ FIREBASE ▬▬▬▬▬▬▬▬▬▬
    ► 14 - Setup Firebase in Flutter • Simplest way to Setup ...
    ► 15 - Firebase Authentication • Flutter Firebase Authe...
    ► 16 - Firebase Phone No Auth • Flutter Firebase Phone...
    ► 17 - Flutter Profile UI • Flutter Profile Page U...
    ► 18 - Store Data in Firestore • How to store data in F...
    ► 19 - Verify Email in Flutter • Verify Email in Fireba...
    COURSES
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ► FLUTTER CRASH COURSE • Flutter Crash Course f...
    ► LOGIN APP with GETX • Flutter Login App - UI...
    ► E-COMMERCE APP • Professional Flutter E...
    CHAPTERS
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    00:00 Firebase Auth example and Overview
    03:06 Enable Email and password in Firebase Console
    04:05 Setup Firebase auth in Flutter
    05:27 Add Logic to get user data
    08:41 Firebase Authentication Repository Signup, Login and Logout
    15:44 Firebase Auth Exceptions
    19:40 Test the Code
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    FOLLOW US ON SOCIAL MEDIA!
    💻 Facebook: / codingwithtea
    💻 Instagram: / coding_with_tea
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    SUPPORT
    To support the creation of a free content please visit:
    ► Subscribe th-cam.com/users/Codingwithtea...
    ►► Support codingwitht.com/support-the-c...
    #flutterapp #flutterfirebase #firebaseauth #codingwithTea
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 113

  • @xturki5741
    @xturki5741 11 หลายเดือนก่อน

    Hi sir, first of all thank you very much for this videos , i have question i have test in on real device but there is problem in signup form screen when i pressed on the field the keyboard just show and disappear in less than one second .. can i know why ?

  • @rajvi5573
    @rajvi5573 10 หลายเดือนก่อน +1

    Great video. Can you also make a tutorial for the Login logic? Your code that I purchased has a lot of things that have not been covered in this tutorial yet and is a bit confusing so will be great if you could explain in a similar fashion as you did for the Sign Up logic. Thanks!

  • @ybing2142
    @ybing2142 ปีที่แล้ว

    Hi, Sir. The code of userChanges() in video 12:41, it shows "The method 'userChanges' isn't defined for the type 'FirebaseAuth'." for my project. I have upgrade my firebase_auth version but it still the same. May I know any solution for this? and really appreciate for your videos, they help me a lot in my studies.

  • @Jnims07
    @Jnims07 9 หลายเดือนก่อน

    Hello Sir, when I click on a text input field in my app's signup form, the keyboard keeps disappearing repeatedly.

  • @saadjillani7761
    @saadjillani7761 ปีที่แล้ว +2

    I'm folowing this series from the start. Sir where is the code block for loginUserWithEmailAndPassword? If you already create a video on it, please mention

  • @CreativeMindOfficials
    @CreativeMindOfficials 5 หลายเดือนก่อน

    Bro. I have ListTile icon in the Drawer header. I want to perform logout by clicking on ListTile Logout icon. How to do this. I tried but not logout.

  • @AliHaider-hs8ff
    @AliHaider-hs8ff ปีที่แล้ว +4

    I wanted to take a moment to express my appreciation for your great videos. They have been a valuable resource in my studies. However, I do have a small complaint. I have spent a lot of time going through your playlist, and now I am eagerly waiting for the video on login authentication. Unfortunately, my project evaluation is starting next week, and I am running short on time.
    I kindly request that you consider creating a video on login authentication before this Saturday or Sunday.

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +3

      Hi Ali Haider, thank you so much 🥰. I will create login authentication video soon but you can also send me a message at +923178059528 for quick fix 😆

    • @AliHaider-hs8ff
      @AliHaider-hs8ff ปีที่แล้ว +1

      @@CodingwithT You're welcome! and I'm on way to disturbing you on WhatsApp hahaha😂

  • @CodingwithT
    @CodingwithT  ปีที่แล้ว +2

    Hello everyone, Most of the people asked for LoginScreen Code as it's already added in the codingwitht.com and link was given in the description. You can also follow this link.
    codingwitht.com/flutter-firebase-authentication-tutorial-2022-using-getx/

  • @user-oc2jj7ii9r
    @user-oc2jj7ii9r 8 หลายเดือนก่อน +1

    sir pls help in this why splash screen is not showing i am getting this error

  • @pixel__lord
    @pixel__lord ปีที่แล้ว +2

    Great Series , please make admin panel as well

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +1

      Thank you. I'll make it

  • @abdelbaki343
    @abdelbaki343 ปีที่แล้ว +1

    hello how can I create a Flutter app with a login interface that allows the user to choose between admin or client login

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +2

      Simply create a field in the firebase and name it roles, based on that when the user is authenticated, check its role from the database and redirect accordingly.

  • @akshaysardhara2951
    @akshaysardhara2951 ปีที่แล้ว +1

    You are CodeStar big brother..🎉🎉

  • @evanscott2936
    @evanscott2936 11 หลายเดือนก่อน +1

    followed your last video step by step. I did the same for this video. however when initialized the app at 5:00 I did not have a src folder in my lib. what am I doing wrong????????

    • @CodingwithT
      @CodingwithT  11 หลายเดือนก่อน

      If you watch my first tutorials of this course in which I thought about folder structure, then you'll know that src is just a folder nothing else.
      If you don't have that. Don't worry.

    • @maxxy-r3q
      @maxxy-r3q 2 หลายเดือนก่อน

      he use flutter_native_splash for the first loaded screen before everything in authcontroller fine

  • @izzuddeenshahpudin1606
    @izzuddeenshahpudin1606 6 หลายเดือนก่อน +1

    where do you create the getxcontroller class and the get method for get.find etc.. Sory if I have missed some points hehe

    • @jethroruel
      @jethroruel 2 หลายเดือนก่อน

      Same problem here... Hope u will answer bro

    • @dipeshadhikari5560
      @dipeshadhikari5560 21 วันที่ผ่านมา

      in terminal > flutter pub add get

  • @greendiga
    @greendiga 11 หลายเดือนก่อน

    Hi, thank you so much for the very detailed code, but when I want to log in or log in to the program, I get such an error in the console. The code is the same as in the video [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled exception: You are trying to use context-free navigation without . I will be grateful for your help.

    • @greendiga
      @greendiga 11 หลายเดือนก่อน

      firebaseUser.value != null ? Get.offAll(() => const profile()) : Get.to(() => const MyApp());

    • @CodingwithT
      @CodingwithT  11 หลายเดือนก่อน

      You welcome 🤗.
      Have you changed MaterialApp to GetMaterialApp
      You Need to Add GetMaterialApp In Your Main.dart file for GetX .

  • @Pierotkana
    @Pierotkana 5 หลายเดือนก่อน

    hey, in 21:43 min - I follow code with you but in my app signOut() does not working, only after hot reload user logouts..

    • @CodingwithT
      @CodingwithT  5 หลายเดือนก่อน +1

      Make sure to check if authentication listener is working and also if you're not using that then manually redirect to Login screen in logout()

  • @HyderabadiEmraan
    @HyderabadiEmraan ปีที่แล้ว

    Thanks!

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Thank you Buddy Wasif for your love and support 💕.

  • @sarkheelmughal6545
    @sarkheelmughal6545 ปีที่แล้ว +1

    great video. it signup the user successfully but where is the functionality of login screen? how can we send email verification mail

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Email verification is actually a Complete new tutorial, IA i will cover it soon.
      Whereas you can Login by calling the login function from the auth repository on the login button onPressed

  • @mawandenxumalo4901
    @mawandenxumalo4901 ปีที่แล้ว +1

    how do i handle this error 'Unhandled Exception: Instance of 'SignUpWithEmailAndPasswordFailure'

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Try to run it in debug mode. There is an uncaught exception inside your Email and password failure.

    • @mawandenxumalo4901
      @mawandenxumalo4901 ปีที่แล้ว

      @@CodingwithT thanks I did but now I'm getting "W/System ( 9315): Ignoring header X-Firebase-Locale because its value was null." assistance will be highly appreciated..

  • @restaurantrecipebyhafsa
    @restaurantrecipebyhafsa ปีที่แล้ว +1

    why I am redirecting to the dashboard without entering the signup details email and password.

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +1

      Send me code at support@codingwitht.com

    • @skydoesblue4854
      @skydoesblue4854 ปีที่แล้ว

      Same issues here

    • @restaurantrecipebyhafsa
      @restaurantrecipebyhafsa ปีที่แล้ว

      @@skydoesblue4854 try implementing the logout functionality. It is just because the user is already logged in to your app so the app redirects the user to its dashboard. So when you will logout the user. it will work fine.

  • @bobdaawid2218
    @bobdaawid2218 หลายเดือนก่อน

    I have a question. Can Getx be used for a larger application?

    • @CodingwithT
      @CodingwithT  หลายเดือนก่อน

      Yes easily

  • @rinkuedutech
    @rinkuedutech 8 หลายเดือนก่อน +1

    Hi Sir, thank you so much for your videos. But I am facing the error E/flutter (12573): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'signUpEmailAndPasswordFailure'.I have changed the Material App to GetMaterialApp but app is not switching from signup screen to dashboard screen and the problem is same.I will be very thankful for your help.E/flutter (12573): #0 AuthenticationRepository.createUserWithEmailAndPassword (package:flutter_login/src/repository/authentication_repository/authentication_repository.dart:39:4)
    .This is also alongwith problem.

    • @rinkuedutech
      @rinkuedutech 8 หลายเดือนก่อน

      Sir I sort out the issue by replacing "firebaseUser.value!=null ? Get.offAll(()=>dashboard()): Get.to(()=>welcomeScreen());" with "Get.offAll(()=>dashboard()):". May be firebase user value creating problem with "null".

  • @ikkekun
    @ikkekun ปีที่แล้ว

    can you answer my question ? im having an error with LateInitializationError: Field 'firebaseUserl has not been initialized... why this happened? i already follow ur code

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +1

      Please check if it's late or ? Nullable as both have different approaches.
      Also it should be initialized in onReady if the error is in Authentication Repository

    • @ikkekun
      @ikkekun ปีที่แล้ว

      @@CodingwithT im using late final as in the video. there is no error code but error on the profile page at the phone

    • @favouradeshina4354
      @favouradeshina4354 ปีที่แล้ว

      I'm currently experiencing this by the way. How did you fix it? @ikekun

    • @ikkekun
      @ikkekun ปีที่แล้ว

      @@favouradeshina4354 i give up bro, i recommend you to find another way

  • @usertuserb7057
    @usertuserb7057 ปีที่แล้ว +1

    Wa alaykoum essalam.
    geat video thanks a lot.
    please make video about Sqlite.

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Thank you 😊 and I will

  • @user-pm6sw9gt7m
    @user-pm6sw9gt7m ปีที่แล้ว +5

    Workaround for login page logic is to add these lines of code to login_form_widget.dart that was made in previous tutorial that Tea posted.
    1. add controllers into LoginForm widget:
    @override
    Widget build(BuildContext context) {
    final controller = Get.put(SignupController());
    [...]
    //EMAIL FIELD
    TextFormField(
    controller: controller.email,
    [...]
    //PASSWORD FIELD
    TextFormField(
    controller: controller.password,
    [...]
    2. Add OnPressed Login Button logic:
    onPressed: () {
    FirebaseAuth.instance.signInWithEmailAndPassword(
    email: controller.email.text.trim(),
    password: controller.password.text.trim()
    );
    How to show users that info they inputted is not correct is another problem I'm facing now.

    • @mrman4636
      @mrman4636 ปีที่แล้ว +1

      add this in your textformfield widget :
      validator: (value) {
      if (value == null || value.isEmpty) {
      return " enter the thing. Idiot!!!";
      } else
      null;
      }
      then put your onpressed function in this:
      if (_formkey.currentState!.validate()) {

      }
      so yours will be like:
      onPressed: () {
      if (_formkey.currentState!.validate()) {
      FirebaseAuth.instance.signInWithEmailAndPassword(
      email: controller.email.text.trim(),
      password: controller.password.text.trim();
      }
      }
      ps: _formkey is private hence the underscore

    • @user-pm6sw9gt7m
      @user-pm6sw9gt7m ปีที่แล้ว

      @@mrman4636 thank you! Only problem is that it only checks if the input field is empty. My problem is comparing data that is input by user with firebase data.
      Say I am I user and I put in wrong password with one letter/number/symbol missing. The validation above would not show anything to me. Right?

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Most of the people asked for LoginScreen Code as it's already added in the codingwitht.com and link is given in the description of the video but now you can get it from right below...
      codingwitht.com/flutter-firebase-authentication-tutorial-2022-using-getx/

  • @Abhigyan103
    @Abhigyan103 ปีที่แล้ว

    Which code is helping the app remember the login state on relaunching ?

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +1

      In the authentication repository look for onReady() function and call that in main.dart

  • @anarabbas2728
    @anarabbas2728 ปีที่แล้ว +1

    Super videos.

  • @Nuur_Rajput
    @Nuur_Rajput 7 หลายเดือนก่อน

    SIRRRR!!!! where did that loginwithwithemailandpassword come from .... explain plzzz , it is giving error .... i dont have that code

    • @CodingwithT
      @CodingwithT  7 หลายเดือนก่อน

      Sorry for the inconvenience. Please watch the current ongoing e-commerce playlist and see the updated videos.
      That'll be helpful 😃

  • @_RicardoDirkAnderson
    @_RicardoDirkAnderson ปีที่แล้ว +2

    how to make signin man??

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Most of the people asked for LoginScreen Code as it's already added in the codingwitht.com and link is given in the description of the video but now you can get it from right below...
      codingwitht.com/flutter-firebase-authentication-tutorial-2022-using-getx/

  • @pawankumarbairwa7509
    @pawankumarbairwa7509 ปีที่แล้ว +1

    great video bro. bro how can we upload image with userAuthontication

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      That's easy dear. You have to store images and videos in Firebase Storage

  • @dooooofy
    @dooooofy ปีที่แล้ว +2

    How about login sir? What should we put in login button to make login?

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Once the account email and password has been successfully registered (authenticated) you can use the same email and password to login .

    • @dooooofy
      @dooooofy ปีที่แล้ว +3

      @@CodingwithT //LOGIN BUTTON
      SizedBox(
      width: double.infinity,
      child: ElevatedButton(
      onPressed: () {},
      child: Text(tLogin.toUpperCase())),
      )
      I mean, what code should we put in this sir, I look for another videos on TH-cam and I can't understand most of them. I understand your video but I lack of info about login. Thanks

    • @jailbreak_4162
      @jailbreak_4162 ปีที่แล้ว +1

      @@CodingwithT I encounter same problem sir. What we will put into login form to recognize the credentials from the sign in we created?

    • @emmanuelpcharles5614
      @emmanuelpcharles5614 ปีที่แล้ว

      any solution to this , doesn’t work

    • @gowthamkumarkommana
      @gowthamkumarkommana ปีที่แล้ว

      same issue please help

  • @asadmaeem8262
    @asadmaeem8262 ปีที่แล้ว

    where did that signupwithemailandpassword came from...just after loginwithwithemailandpassword....its giving errors plz explain

    • @asadmaeem8262
      @asadmaeem8262 ปีที่แล้ว

      i am sorry i got it...i didnt imported the firebase_core Package

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Sorry for the delay and glad it worked 😃

  • @idrisalparslan2312
    @idrisalparslan2312 5 หลายเดือนก่อน

    Eyvallah baba eyvallah

  • @mechtarin
    @mechtarin ปีที่แล้ว

    so what is the purpose of the package that we created before

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว +1

      First I thought to add things in the package but after realizing that people will easily get confused, therefore I decided to not use it 😭.🤓

    • @mechtarin
      @mechtarin ปีที่แล้ว

      @@CodingwithT that would be better if you used modularizing is something important so I wish I can see that on this course but I will try by myself with other resources thanks a lot for this great course

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      I will do that soon

  • @user-rw8oe4io9p
    @user-rw8oe4io9p ปีที่แล้ว +1

    can you please provide the login controller code

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Most of the people asked for LoginScreen Code as it's already added in the codingwitht.com and link is given in the description of the video but now you can get it from right below...
      codingwitht.com/flutter-firebase-authentication-tutorial-2022-using-getx/

  • @jyotibaruah1085
    @jyotibaruah1085 ปีที่แล้ว

    Whenever I try to enter text into a TextFormField, the keyboard pops up for a second and hides away instantly.
    Please help🙏

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Is your issue resolved? Sorry for the late reply 😃

    • @jyotibaruah1085
      @jyotibaruah1085 ปีที่แล้ว

      Its ok🤗..but no my issue is not yet resolved..

    • @gowthamkumarkommana
      @gowthamkumarkommana ปีที่แล้ว

      same issue please help

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      You can make the GlobalKey variable static and initialize in init

    • @gowthamkumarkommana
      @gowthamkumarkommana ปีที่แล้ว

      @@CodingwithT working thanks😁

  • @faizanahmed8844
    @faizanahmed8844 ปีที่แล้ว +1

    if anyone confuse how to login then come into my comment i will share the code Thanks

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Thank you Faizan for help.
      Most of the people asked for LoginScreen Code as it's already added in the codingwitht.com and link is given in the description of the video but now you can get it from right below...
      codingwitht.com/flutter-firebase-authentication-tutorial-2022-using-getx/

    • @irfansamii695
      @irfansamii695 11 หลายเดือนก่อน

      share please

  • @lasithaharshana9749
    @lasithaharshana9749 7 หลายเดือนก่อน

    Plz ,I need login backend :/

    • @CodingwithT
      @CodingwithT  7 หลายเดือนก่อน +1

      You will see the login back-end tutorial in this ongoing e-commerce app playlist.
      Login video will be uploaded this week.

  • @pasirukir4277
    @pasirukir4277 ปีที่แล้ว

    Hallo sir, I got error message like shown:
    The following message was thrown while handling a gesture:
    "AuthenticationRepository" not found. You need to call "Get.put(AuthenticationRepository())" or "Get.lazyPut(()=>AuthenticationRepository())",
    how to solve it, thanks and regards

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      As it says, you just have to use the final controller= Get.put(AuthenticationRepository())
      It means that you first have to create the instance of any class using Get.put and in the rest of the Classes later on you can use an instance.

    • @RynoDyno-ef6it
      @RynoDyno-ef6it ปีที่แล้ว

      @@CodingwithT Where would we be putting this code? Thank you so much for all your help!

    • @manavsharma3655
      @manavsharma3655 10 หลายเดือนก่อน

      i am getting the same error but i still cant figure it out. it would be very helpful if u could explain how to solve this issue in detail@@CodingwithT

    • @Liuyap
      @Liuyap 4 หลายเดือนก่อน

      help@@CodingwithT

  • @buna8355
    @buna8355 3 หลายเดือนก่อน

    Please include signin_email_password_failure.dart

  • @rakibulhasanjoy7158
    @rakibulhasanjoy7158 ปีที่แล้ว +1

    options: DefaultFirebaseOptions.currentPlatform
    This line is showing error

    • @CodingwithT
      @CodingwithT  ปีที่แล้ว

      Check if the dependency added and also tro to Run Pub clean and Pub get