Flutter Firebase Phone Auth Tutorial For Beginners | Firestore, Firebase Storage, Auth (Latest)

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Hello everyone, in this video we will be learning how to implement a phone authentication system in flutter and firebase. We will be using firebasefirestore, firebase storage, authentication.
    Source Code:
    / 75827635
    ► Join Patreon
    / backslashflutter
    Sign up for 10,000 free mins: bit.ly/3X32Jup
    Find out more about ZEGOCLOUD: bit.ly/3AmrNmi
    Guides to build chat app: bit.ly/3hQqAx2
    ► ALSO LEARN TO INTEGRATE GOOGLE and FACEBOOK SIGN IN TO YOUR APPS:
    📗 Complete Google and Facebook Login In Flutter | Flutter & Firebase Authentication 2021 (Part 1)
    • Complete Google and Fa...
    📗 Facebook Login In Flutter | Flutter & Firebase Authentication For Beginners 2021 (Part 2)
    • Facebook Login In Flut...
    🔔 Get updated with my projects🔔
    Follow me on Github: github.com/backslashflutter
    #chewieplayer #fluttervideoplayer #backslashflutter

    🔥 Subscribe for more:
    / backslashflutter
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If this helps make sure to share it with friends and colleagues who will benefit from this
    Have questions/queries? 💬 Comment below I will be happy to help
    ►For the 3D intro, I'm using Rotato: rotato.xyz
    🎵Credits :
    Music Used:
    JARICO - LANDSCAPE • Video
    softy x no one’s perfect - The Beauty Around Us ✨ [lofi hip hop/relaxing beats]
    Reddit Username : @backslashflutter
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    🔗OTHER:
    PLAYLIST:
    1. FLUTTER AND FIREBASE
    LINK :bit.ly/35Uq7Ba​
    2. FLUTTER SPEEDCODE
    LINK: bit.ly/3sFDy1O
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    OTHER VIDEO:
    Complete Flutter Installation & Setup Tutorial For App Development on MacOS (Latest)
    • Complete Flutter Insta...
    Learn API Integration in Flutter | Building A Dictionary App with OwlBot API | (Under 20 Minute)
    • Learn API Integration ...
    ChatBot App In Flutter | Python Backend With Flutter | Heroku Server (Full Explanation)
    • ChatBot App In Flutter...
    About Flutter:
    Flutter is an open-source UI software development kit created by Google. It is used to develop cross platform applications for Android, iOS, Linux, Mac, Windows, Google Fuchsia, and the web from a single codebase. The first version of Flutter was known as codename "Sky" and ran on the Android operating system.
    THANKS FOR LOVE AND SUPPORT💪

КОМЕНТАРІ • 146

  • @backslashflutter
    @backslashflutter  Рік тому +4

    Other best method to setup default phone
    Country country = CountryParser.parseCountryCode('IN');
    // IN is for indian phone number

    • @ChiragRathod-m5d
      @ChiragRathod-m5d Рік тому

      Phone authentication time Recapcha how can remove android & ios both.

  • @kenethnjoroge5313
    @kenethnjoroge5313 Рік тому +5

    I will only say this... THIS IS PURE GOLD!!! THANKS MAN!

  • @techadot
    @techadot 11 місяців тому +4

    As of today, this video is valid. And for those getting errors, watch the video with patience, do not skip any path, follow all due process in the video. Thanks @backslashflutter💙, from Nigeria 🇳🇬

  • @prashantkhare
    @prashantkhare Рік тому +1

    Thank you very much for making such a beautiful tutorial in a very easy way, May god bless you

  • @mazenal-ali765
    @mazenal-ali765 Рік тому +1

    thank you very much for such a creative and useful content. There is a big problem with this approach that I couldn't solve, when a user enters phone number and verify the OTP he will be redirected to the registration screen to fill the information, if anything interrupt this process and user didn't complete the rest of the information next time when the user opens the app it will redirect to the home screen and all info will show as null.
    how can prompt the user to enter the missing information incase he didn't complete them?

    • @backslashflutter
      @backslashflutter  Рік тому

      you mean the otp verification is completed and user is there on information page. What you can do is to store a new key in shared preference for isSignedIn which is alreay present i guess and only save that isSignedIn to true once information is filled and save is clicked.

  • @afrikanking4022
    @afrikanking4022 Рік тому +3

    On Android the otp comes as expired. My man you did really well making this video. please help us complete. Android is not working

    • @backslashflutter
      @backslashflutter  Рік тому +1

      ya mate i know android is causing isssue with captcha but the expired otp is not the case. PLease check the code from github if issue still exists.
      github.com/backslashflutter

    • @sakshamavasthi1013
      @sakshamavasthi1013 Рік тому

      which repository provide the exact link please

  • @johnkim7321
    @johnkim7321 Рік тому +1

    You're great! 😀It helps me a lot. Please upload more lectures.

  • @sush.07
    @sush.07 9 місяців тому

    thank you so must, you added value in my coding love from mumbai.

  • @oussamasbisiane4544
    @oussamasbisiane4544 Рік тому

    thanks dude u really help me with that very simple code to understand and make my own changes

  • @tricks-app
    @tricks-app Рік тому

    Thanks for the video, Could you make a video that tells all the vscode plugins you are using. I like the one where you collapsed the code within the brackets @ 1:17:42. thank you.

  • @drmsa1982
    @drmsa1982 Рік тому

    28:40 just keep the setState empty and it will update the icon without reversing the numbers
    onChanged: (value) { setState(( ) { }) ; },
    and no need for additional code.
    Thanks for your video.

  • @codingmafia1642
    @codingmafia1642 8 місяців тому

    Perfect , can you assist ho do I prevent double sign-in in different devices using same number

  • @sudharshan2082
    @sudharshan2082 7 днів тому

    When i click on login ,, nothing happens ,, i get the message in debug console
    The input method toggled cursor monitoring on
    The input method toggled cursor monitoring off
    The input method toggled cursor monitoring on

  • @juliokavege9772
    @juliokavege9772 Рік тому

    Thank for this greatest content. Can please also show as how to automaticaly retreive sms code on the otp screen?

  • @amolharsh7375
    @amolharsh7375 Рік тому

    Hello Backslash Flutter,
    I have subscribed your channel and actively watch your videos.
    Thanks for creating these wonderful and informative contents.
    I have a query. At timestamp 1:08:52 , why are you changing the settings in the App Check thing? I was not able to understand. Why is it necessary to do that?
    Thanks

    • @backslashflutter
      @backslashflutter  Рік тому

      this is there to enable the firebase integration for phone auth and other monitoring for billing and spam frauds. I saw that phone auth's recaptcha bypass was done through this so integrated this

  • @Sheikh_Sakibul_Islam
    @Sheikh_Sakibul_Islam Рік тому

    to add dependency just click "f1" then search "add dependency" then paste the name , simple

  • @abrarlasebai405
    @abrarlasebai405 Рік тому

    amazing content, BIG LIKE From Libya 👏👏
    Best of Luck 🌸🌸

  • @MR_Football_001
    @MR_Football_001 Рік тому +1

    when i click continue : No App Check token for request. any help please ?

  • @sukooon
    @sukooon Рік тому +1

    Can you please make a video on forget password and reset password through an email link

  • @KaranPalav
    @KaranPalav 3 місяці тому

    But from windows native setup not possible for ios have to go with flutter app right ?

  • @mochouinard
    @mochouinard Рік тому

    First, thanks alot for making this video, it was amazing for me to get started, I just finished watching it all, so here a few issues I found :
    28:19 This cause multiple bugs. You should not set text = value. You only need an empty setState. This also mean you don't need the following code shown to move the cursor at this end.
    One of the code error I saw was you put the phoneNumber inside the uid somewhere (I don't recall where, I just didn't wrote it like this on my end).
    The rest might be me, since I rewrote all the code, you were quick and I might have missed a function.
    But I'm on Android, and visually it doesn't work well... I guess it need some way to adjust the visual it feel good to use when the keyboard show up.
    I got it to work with the fake SMS number, but if I use a different SMS number, the app stop in debug mode somewhere.
    Also, when you enter the wrong OTP code, I need to rotate my phone (to trigger the setState()) so it bring me back.
    I'm don't fully understand how you implement authentication... Once a user is signed in, there is no authentification being made to firebase ? It seem to just read a local variable in the checkSign() Shouldn't it check the Firebase backend to see if it true or not ?.

    • @backslashflutter
      @backslashflutter  Рік тому

      whooooo, seems like you encountered lot of bugs. I am sorry for this. Let's connect over gmail if you still face this issue
      backslash.flutter@gmail.com

  • @mohammednawar9417
    @mohammednawar9417 7 місяців тому

    Thank you dear for an amazing tutorial

  • @ForYt-d6b
    @ForYt-d6b Рік тому

    Hey i want to store a number which doesn't conten country code
    How to do that?
    I am using firebase firestore
    I am using otp authentication

  • @msmsmsms1237
    @msmsmsms1237 Рік тому

    Thanks its grait video, it works on android but not on ios, when I run pod install it gets shared pref foundation NOT ios

  • @sadanandasherigara3309
    @sadanandasherigara3309 Рік тому +1

    I want join as patreon member. I don't know how you downloaded iOS simulator and open it with vscode.

    • @backslashflutter
      @backslashflutter  Рік тому

      you can become part of patreon community here;
      www.patreon.com/backslashflutter

  • @anillimbu7092
    @anillimbu7092 Рік тому

    Hello thanks for the video but I ma getting a problem when I click the continue button in user_information_screen.dart it says User ID is not initialized!, what is wrong with my code anyone please help me.

  • @abhijitnag8161
    @abhijitnag8161 Рік тому

    play integrety api that error is not being resolved please help how to solve it. again and again it is showing an error occurred while accepting terms and conditions similar to your video. Please solve this.

  • @arshiajs
    @arshiajs Рік тому

    tnx to your great video, 1 issue: in "userinformationscreen" , userModel: userModel gets an error, How to fix it ?

    • @backslashflutter
      @backslashflutter  Рік тому

      can you please share more detail. If you want please go through the github repo and check the source code there>
      github.com/backslashfluttter

  • @nwaekwuchukwuebukajohnpaul8798

    After adding country picker pub dev
    How was the country class created

    • @backslashflutter
      @backslashflutter  Рік тому

      I mentioned it in pin comment mate
      Country country = CountryParser.parseCountryCode('IN');

  • @snopcatdeveloper653
    @snopcatdeveloper653 Рік тому

    please make video on resend otp with timer and custom errors handling

  • @seetheworld3839
    @seetheworld3839 Рік тому

    hey buddy what to do so that i dont go to that captcha screen as it isnt a good user experience

  • @hrithikreddy-upgradhooman87

    Hey Hi I really liked the tutorial but found few bugs when i started to trail the 2nd user to login at: 1:55:26 I have put the code exactly as you taught but it says firebase_storage/unknown and its not allowing me to store the user data. Could you please help me out with this it would be a great help.... Thank You

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 3 місяці тому

    can i sue firebaseAuth to send sms for forget password verification otp to the user's mobile number?

  • @collinsmutai613
    @collinsmutai613 Рік тому

    thanks for the great video,
    just have an issue my country code picker on android initially is blank but after starting to input a phone number it displays(only displays country code and flag when field is active)

  • @genelizleyici6739
    @genelizleyici6739 Рік тому

    When I restart the app my userModel variable in the provider doesnt't work proparly. I can't use the data from firebase. Can anyone help me please?

  • @faissi21
    @faissi21 7 місяців тому

    you are the goat bro

  • @NikeshMadhav
    @NikeshMadhav Рік тому +3

    Hi can you add sms autofill feature into it as well

    • @backslashflutter
      @backslashflutter  Рік тому +3

      Sure will add it

    • @ibrahimkhattab369
      @ibrahimkhattab369 Рік тому

      @@backslashflutter Can you please add this one cuz I'm suffering with adding the autofill functionality to the app I'm working on

    • @unknownking139
      @unknownking139 Рік тому

      Please when you will add it ???

    • @ForYt-d6b
      @ForYt-d6b Рік тому

      Hey i want to store a number which doesn't conten country code
      How to do that?
      I am using firebase firestore
      I am using otp authentication

  • @NicolasBissinger
    @NicolasBissinger Рік тому

    thanks for your video man.

  • @zubairahmad7307
    @zubairahmad7307 Рік тому

    I am getting error on this line
    await Firebase.initializeApp();
    Exception has occurred.
    PlatformException (PlatformException(null-error, Host platform returned null value for non-null return value., null, null))
    how I correct?

    • @syedquadri3922
      @syedquadri3922 11 місяців тому

      Hi. Try adding this dependency.
      Use this package as a library
      Depend on it
      Run this command:
      With Flutter:
      $ flutter pub add provider
      This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
      dependencies:
      provider: ^6.1.1

  • @ForYt-d6b
    @ForYt-d6b Рік тому

    Hey i want to store a number which doesn't conten country code
    How to do that?

  • @anshajlogan1040
    @anshajlogan1040 Місяць тому

    Reserved client id not showing on my plist file

  • @berkanyukselgun5496
    @berkanyukselgun5496 Рік тому

    I can't continue after 1:09:00. Play integrity does not approve. Is there a video on how to fix this? How can I verify sms for an application that is not installed in the play store?

    • @sadeemkhalid4219
      @sadeemkhalid4219 8 місяців тому

      did you solve it? i am facing the same problem

  • @joshyabraham670
    @joshyabraham670 Рік тому

    Hi I have mailed a specific problem about storage and the link to the git repository.Please have a look and give suggestions, if any.

    • @backslashflutter
      @backslashflutter  Рік тому

      sir, i am really occupied with lot of things, will suggest to battle this for a while.

    • @joshyabraham670
      @joshyabraham670 Рік тому

      @@backslashflutter solved the issue.. thanks

  • @aouadicharaf1038
    @aouadicharaf1038 10 місяців тому

    Subbed! ❤❤❤

  • @RahulRanjan-p6z
    @RahulRanjan-p6z Рік тому

    how to make the change to fill auto OTP in this verification page ?

  • @philosophia5577
    @philosophia5577 Рік тому

    Great video buddy but work on Audio Quality.

  • @angelconsolalopez4254
    @angelconsolalopez4254 Рік тому

    Hi, I can't get the SHA-1 cetificate, keystore not found, what can I do? Could I connect the project to flutter firebase instead of android?

    • @backslashflutter
      @backslashflutter  Рік тому

      yes there is a very detailed video on my channel regarding that, please have a look at it

  • @secrescence
    @secrescence Рік тому

    are you using m1/m2 macbook?

  • @kumsakitessaofficial3721
    @kumsakitessaofficial3721 Рік тому

    please no app check option in my firebase under project setting, so can you help me please

    • @backslashflutter
      @backslashflutter  Рік тому

      this is the issue which most people are facing mate. when i find way out then will definitely let you know

  • @saadrajpoot2387
    @saadrajpoot2387 2 місяці тому

    Thanks but how to resolve recaptcha

  • @TrencTolize
    @TrencTolize Рік тому

    I've been following several different tutorials on setting up Firebase now and they all show that it should be working in this way. However, for me it always throws the error "FirebaseOptions cannot be null when creating the default app." I've tried it on Windows and on Mac and it's always the same error. InitializeApp() seems to not work anymore without specifying the options parameter, or it's just me.

    • @backslashflutter
      @backslashflutter  Рік тому

      hahaha mate, i have been using it for long time rather without this no one can integrate the firebase. please check the steps like google-service.json file and other things if you have implemented that.

  • @henoktesfaye7130
    @henoktesfaye7130 10 місяців тому

    where is the link to the image resource?

  • @manishmaurya450
    @manishmaurya450 10 місяців тому

    hy i followed all but there is some issue its working fine in debug mode but in release apk otp is not coming
    pls help

    • @favourwilliams7319
      @favourwilliams7319 9 місяців тому

      i got this same error where you able to fix it??

  • @factGraphic
    @factGraphic Рік тому

    After safetynet how we can remove captcha it is the reason for loses many user from our app how we can remove recaptcha verification ill tried play integrity api but i can't

    • @backslashflutter
      @backslashflutter  Рік тому

      Most people are waiting for some solution from google for this, on IOS i know this can. be easily done with APNs configuration setup on firebase and ios device. I am able to integrate that on ios, but for android i am still waiting for some solution, will let you know if i have any.

  • @aryangupta7990
    @aryangupta7990 6 місяців тому

    HOW TO REMOVE CAPTCHA REDIRECT, PLEASE PROVIDE SOLUTION FOR THAT 🙏🙏🙏🙏🙏🙏

    • @AaryaZunjarrao
      @AaryaZunjarrao 5 місяців тому

      Hello I just want to ask is the app working properly.should I follow this video for 2 hours

  • @ahmedfayez3821
    @ahmedfayez3821 Рік тому +1

    hello , we need the sourse code pro

  • @hans7714
    @hans7714 9 місяців тому

    Thanks for sharing

  • @arunsharma4792
    @arunsharma4792 Рік тому

    yes the same error is coming at my end in app check
    please tell how to resolve it

  • @seifsalmaan
    @seifsalmaan 8 місяців тому

    MASTERRR!!!!

  • @richard2845
    @richard2845 11 місяців тому

    thanks. good video

  • @rajeshsanuria5656
    @rajeshsanuria5656 Рік тому +1

    reversed client id is not show in google service file

    • @Akhi.yt45
      @Akhi.yt45 Рік тому

      did you find it reversed client id if yes let me know please

    • @backslashflutter
      @backslashflutter  Рік тому

      it is visible in google service.plist file for ios, on android you don't need it as such.

  • @ebenezerocansey2920
    @ebenezerocansey2920 Рік тому

    Thanks for the video but there is one problem. If you log out and u want to log back in with the same number, an OTP is sent to you but when you enter the OTP it still asks you to put in your OTP. it does not take you to the HomePage as it should

    • @sheralikhtk5200
      @sheralikhtk5200 Рік тому

      same here.

    • @random_akki
      @random_akki Рік тому +1

      hey did you get any solution for this?

    • @backslashflutter
      @backslashflutter  Рік тому

      can you all check the source code mate. github.com/backslashflutter

    • @ForYt-d6b
      @ForYt-d6b Рік тому

      ​@@random_akkiyes

    • @ansvelmarketplace6264
      @ansvelmarketplace6264 11 місяців тому

      @@backslashflutter, I just check the github repo and couldn't find the source code. Can you please help with the actual link to the repo? I also sent an email to you on this. Thank you so much.

  • @nagamadhugandebathula3363
    @nagamadhugandebathula3363 Рік тому

    will this work on windows vscode?, please let me know

    • @afrikanking4022
      @afrikanking4022 Рік тому

      Yes I followed this video on Windows VScode and it worked well

    • @backslashflutter
      @backslashflutter  Рік тому

      thanks for replying and helping the community @afrikanking4022

  • @bobdaawid2218
    @bobdaawid2218 4 місяці тому

    Thank you sir

  • @siddharthasrivastava
    @siddharthasrivastava Рік тому

    Can I use getX with Provider and will it cause any issue with the performance and stability?

  • @amolharsh7375
    @amolharsh7375 Рік тому

    Please upload how to remove captcha from ios, soon!

  • @royale1223
    @royale1223 Рік тому

    I think it's best not to touch phoneController and keep track of the length in another field.

  • @PankajSinghR
    @PankajSinghR Рік тому

    Thanks now seting default flag problem solved 😃,

    • @backslashflutter
      @backslashflutter  Рік тому +1

      thanks for watching bro

    • @backslashflutter
      @backslashflutter  Рік тому +1

      there are other method also like:
      Country country = CountryParser.parseCountryCode('IN');
      // IN is for indian phone number

  • @ashutoshkapoor5031
    @ashutoshkapoor5031 Рік тому

    1:09:43 it is showing that the safety net is deprecated now
    how to proceed now?

    • @backslashflutter
      @backslashflutter  Рік тому

      yes that is deprected by google. Still many developers face issue with it. All i can tell you is to enable the push notification functionality in your app and try to go through device check thing in firebase

    • @ashutoshkapoor5031
      @ashutoshkapoor5031 Рік тому

      @@backslashflutter okay sure
      And also I used otp_text_field for the OTP field but the verify button is showing "please enter the OTP" even after entering the OTP

  • @kraei9799
    @kraei9799 3 місяці тому

    please share source code?

  • @indomiegoreng8782
    @indomiegoreng8782 4 місяці тому

    terimakasih pak!

  • @ebenezerocansey2920
    @ebenezerocansey2920 Рік тому

    Can you please, from this video add a resend code for authentication. This should be in case the user did not receive the code

    • @backslashflutter
      @backslashflutter  Рік тому

      add a elevated button and assign resend as text to the child of that elevated button, and in the onpress just simply call the same verifyOtp thing that you were calling.

  • @ForYt-d6b
    @ForYt-d6b Рік тому

    My account automatically logout after few time

  • @vacandboss6484
    @vacandboss6484 Рік тому

    Pls make dream 11 clone in flutter tutorial

  • @ForYt-d6b
    @ForYt-d6b Рік тому

    1:17:45

  • @amanatsingh2205
    @amanatsingh2205 Рік тому

    Can you guide me what to do next
    I have completed Flutter Course From Udemy By Academind by Maximilian Schwarzmüller
    How to become better and better in app development

    • @backslashflutter
      @backslashflutter  Рік тому

      start with mastering one state management and then start with creating some app which has CRUD operation in firebase flutter and use the state management you used.
      Then subsequently start with API usage, model creation and lot more. Working on some course in flutter will let you know soon.

    • @amanatsingh2205
      @amanatsingh2205 Рік тому

      @@backslashflutter thanks

  • @Raaz02Choudhary
    @Raaz02Choudhary Рік тому +1

    hindi me bhi bola kar bhai thoda achi tarh samjh aayega
    or thoda slow kara kar coding bahut tej chalte ho aap

    • @backslashflutter
      @backslashflutter  Рік тому

      would appreciate if you can understand english well if you want to strive in tech community. I myself don't know it very well but trying is the only way out.

  • @johnkim7321
    @johnkim7321 Рік тому

    1:35:00

  • @dzdevdev
    @dzdevdev 11 місяців тому

    this video helped me a lot!!
    thank you very much, and i invite you to Islam

  • @Dinosaur_._1_.1
    @Dinosaur_._1_.1 Рік тому

    Android studio is much better than vs code

    • @ihxrxh
      @ihxrxh Рік тому

      Give me 5 reasons yo

    • @backslashflutter
      @backslashflutter  Рік тому

      i will prefer visual studio code for flutter dev. I only use android studio if i need to add native functionality to android app that links with my flutter app. Else will suggest not to go there.

  • @divyanshsingh9485
    @divyanshsingh9485 Рік тому

    By

  • @afrikanking4022
    @afrikanking4022 Рік тому

    #backslash Flutter when I use a normal phone number, I get this error which reads The sms code has expired. Please re-send the verification code to try again

  • @ForYt-d6b
    @ForYt-d6b Рік тому

    Hey i want to store a number which doesn't conten country code
    How to do that?
    I am using firebase firestore
    I am using otp authentication