How to Fetch Data from Cloud Firestore in Flutter [2023]

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2022
  • In this flutter Cloud Firestore tutorial, we will learn to fetch data from Firestore in Flutter.
    PLAYLIST: • Flutter Login App - UI...
    We will fetch or retrieve 2 types of data from firebase firestore. Single Record of user and multiple list of users. We will also see how to display Firebase data using Future Builder Widget in Flutter and how can we use ListView.builder in Flutter to display List of records fetched from Cloud Firestore Firebase in 2023.
    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...
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    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...
    #firestore #flutterfirebase #firebaseauth #codingwithT
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @deveshnarkhede7487
    @deveshnarkhede7487 ปีที่แล้ว +4

    Very Helpful video nice explanation, the application interface is very aesthetic! Keep posting such beautiful and helpful content :)

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

      Thank you so much 🥰

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

    Thank you for sharing such a nice tutorial.
    Can you tell me which extension are you using on VS for these lines indicating widget's child?

  • @user-bh6fp1bh5z
    @user-bh6fp1bh5z 11 หลายเดือนก่อน

    hi, thanks a lot for this premium tutorial series! i do have an issue: when clicking on any TextFormField (inside the FutureBuilder), the FutureBuilder loads again 3 times and the keyboard closes again immediatly. Any suggestions?

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

    thanks for your guidline for develop fully function app

  • @tomstevens6820
    @tomstevens6820 2 หลายเดือนก่อน +1

    I get the error TypeError: Instance of 'UserModel': type 'UserModel' is not a subtype of type 'UserModel' any idea what I need to change?

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

    thanks you very much brother.
    please make a tutorial about Sqlite.

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

      Sure Buddy 😃 & welcome 🤗

  • @amarocp
    @amarocp ปีที่แล้ว +5

    Hello, Thanks for useful tutorial. I am getting following error - "type 'List' is not a subtype of type 'UserModel' in type cast" at FutureBuilder in update_profile_screen.dart. Can you help

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

      Because the return type is a single Model named UserModel and you are receiving it in a list

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

      I have a similar error .. type "_Type" is not a subtype of type "UserModel" in type cast.
      Thanks for the tutorial & please help me 😢

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

    You're legend

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

      Thank you 😊

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

      @@CodingwithT What could be the problem I'm getting "Bad state: no elements". on the update_profile_screen.

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

    hey thank you for all your videos, so on my phone it puts the CircularProgressIndicator on loop and now bad state: no element.
    ment try but I did not succeed, I realized that it is when I enter the email only, if I enter the name, telephone number and password it works but as soon as I add the email in data on the Firebase console it does not want
    thank you anyway you are awesome brother

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

      It might be because of some mapping issue. Check your keys as they should be the same as the key in Firebase and also the way to fetch & retrieve.

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

      @@CodingwithT I really didn't succeed so I removed the Email text form field for the moment no big deal

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

    thanks for the tutorial. pls i have an error in this section. i was able to retrieve my data from db to the textform but the issue is if i click on the textform to change the text the CircularProgressIndicator starts loading for about 2secs and the keyboard won't come up for me to change the text, it continues like that. if i reload the app and come back to the profile it takes me back to my homepage and write on the logs "memory deleted" pls i need help on this pls ... looking forward to your quick response thanks

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

      I have the same problem did you find the solution for it?

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

    Hey Tea, you are awesome can you help me in this section. I cannot retrieve the data instead the CircularProgressIndicator keeps running forever

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

      Thank you 😊.
      Can you share your debug state error or exception?

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

      @@CodingwithT there isn't any error, but i can't fetch the data for updating, the circularProgressIndicator keeps running forever

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

      In ProfileController, instead of of just calling _userRepo.getUserDetails(email); return the function like below
      getUserRecord(){
      final email = _authRepo.firebaseUser.value?.email;
      if(email != null) {
      return _userRepo.getUserDetails(email);
      } else {
      Get.snackbar("Error", "Login to continue");
      }
      }

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

    The from snapshot method that is used to get the all the data from the database doesn't seem to work with nested models. Can you do a video when you are retrieving data from the a nested model in the database?

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

      Yes I'm already creating an ecommerce in which you'll learn in detail about Firebase and more professional ways to handle that.

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

    This was very helpful ! Can you upload this code as well ?

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

      It's uploaded on codingwitht.com/flutter-login-app

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

      I can see this one is missing. I will upload it in an hour

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

    After clicking on the edit profile the loading screen is continuing??

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

    Please create a video on how to add user/admin access to an app. Thanks

  • @Hamza-yq7sj
    @Hamza-yq7sj ปีที่แล้ว

    Will you implement forget password back-end?

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

    bro last pa getUserGet ka kya kiya ha ?

  • @edsonhh
    @edsonhh วันที่ผ่านมา

    is it possible "where" with "like"?

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

    can i make a login page ,when user login user will getuser own data from firebase ?

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

      Login means authentication which are 2 different things and yes you can fetch user's stored data anytime

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

    But you haven't shown the AuthenticationRepository in this video

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

    Heyy T, very nice tutorial
    But I am facing issue in fetching the details of the user I am getting "Error, Login to continue". Please guide me.

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

      I think you're not Logged in as per the error you mentioned. Make sure you have logged in via Firebase Authentication before fetching Authentication record.
      Whereas Firestore don't need anything like Login.

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

    AoA
    sir apki website bhe flutter mein bani hui hai?

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

    while fetching regiterview data to profilescreen its showing error of Bad State, no elements

    • @shaikmujahid-hi5uk
      @shaikmujahid-hi5uk หลายเดือนก่อน

      Me also same bro did u get solution for that

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

    hi man i have a problems. Bad state: Too many elements FLUTTER on window profile. I will be grateful if you help♥

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

      I think you are Keys: in your app and they are duplicated. Please look for duplicate keys and your error will be resolved.

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

      @@CodingwithT Hey I am not sure how to solve this error you help is much appreciated.

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

    i am getting issues not getting the email data is not showing

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

      did you find a solution?

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

    Bro iska hi aage continue login with phone and password jo info apun ne register krwayi whi se apne ko login krna hai using phone and password bnao na video I am stucked

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

      Jis Phone Number sy register kiya wo data get kr k compare kr k login karain. I will also make a video on it soon.

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

    what happened in 12:50 ???

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

    you did not pick image from gallery dynamically and not upload into firebase and fetch it. Kindly provide me if you already have done it

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

      Please watch this video for image uploading.
      th-cam.com/video/-NQWNy-5i2E/w-d-xo.html

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

      @@CodingwithT Thank you ❤️

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

    I am getting the error
    "expected a value of string,but got one of type null"

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

      This means you are trying to pass a string value but inside that variable there is no string but a null.

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

      hey man just got the same error, ya. solved. it??

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

      found it. forgot i had some old accounts without usernames

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

      @@CodingwithT why is it so

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

      @@mrman4636 how

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

    Somehow I got this error on showing all user data '_InternalLinkedHashMap' is not a subtype of type 'QueryDocumentSnapshot' . How can I fix this ?

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

      It's because you are not mapping the QueryDocuementSnapshot properly

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

      @@CodingwithT Thank you ❤️. I got my problem solved .

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

      That's awesome 🤩

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

    brother can you plz help me in this

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

      Yeah sure

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

    I am getting error when clicked on edit profile button.
    Error : bad state too many elements

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

      Because you are trying to call .single in some query or list but that value is getting more then 1 so try .first instead

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

      I have typed the same code just as yours.

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

      @@CodingwithT also you have incomplete videos. You didn't provided video for login button controller. I started the series and at the end i came to know that it is incomplete series

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

      @@CodingwithT answer me

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

    Bro don't mind everyone follows your back to back tutorials but in this tutorial you removed otp authentication and you did not clear to everyone

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

      Dear It's not removed, all I used is Email and Password authentication.
      Because all the authentications are the same.

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

      @@CodingwithT okay taimoor bahi but we are beginners and you cannot do this step in this video so thats why🥲
      Thank you and Eid mubarak in advance taimoor bahi❤