List Detail with Cloud Firestore in Flutter

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 162

  • @thesamarthagarwal
    @thesamarthagarwal  6 років тому +1

    If you get errors about Firebase app not being configured, you need to open the iOS workspace in XCode and add the GoogleService-info.plist to the runner project. I had to edit out that step in the video because of some audio issues.

    • @saadhashmi3900
      @saadhashmi3900 6 років тому

      hello i want to get list of all registered user in firebase using flutter... how can i do that ... any idea

  • @abbyhuh1460
    @abbyhuh1460 3 роки тому +1

    you have no idea how much your videos have helped me! i accidentally deleted my files and you brought it back to existence again with these tutorials.
    thank you so much 😄

  • @MapMavericks
    @MapMavericks 5 років тому +22

    This is the best flutter video I've ever watched. I wish Google would hire you to make the tutorial videos. Very nice! Thank you for sharing 😊

  • @nazmulhayat9842
    @nazmulhayat9842 4 роки тому

    thiss iss exactly WHAT I WAS LOOKING FOR PAST FEW DAYSSS thankkkk u sooo muccchh for thiss!!!

  • @omarsharifrajme7061
    @omarsharifrajme7061 4 роки тому

    I was totally confused about two days. You just save me brother. Thank you so much.

  • @huehuehuey5055
    @huehuehuey5055 3 роки тому +2

    for anyone watching in 2021 the snapshot syntax has changed to snapshot.data[index].data()["yourFieldName"]. Note the data() function called on the document of the snapshot array

  • @HarithaMadushankaharryze7
    @HarithaMadushankaharryze7 3 роки тому

    You literally saved my life! Thank you so much. You are an amazing soul!

  • @samii1014
    @samii1014 4 роки тому

    waoooo such amazing content and explanation. you save my day thinks brother.
    hope you will make more videos like this. waiting to watch more flutter videos from your channel

  • @benjamindeworsop8348
    @benjamindeworsop8348 4 роки тому +1

    Incredible video - amazingly clear and beautifully designed! THANK YOU

  • @mhmzdev
    @mhmzdev 5 років тому +2

    You just saved hell of research for me... Thank U so much ❤️

  • @alokyes
    @alokyes 4 роки тому

    dost aapne to raaton neend wapis laadi, shukriya. My code is working now!

    • @aaselab
      @aaselab 4 роки тому

      Hi...Do you know why when ever I tried to run my code, the app won't lunch in simulator. It keep running runing on my vscode but never show up on my simulator. I'm not sure If it's something related to firebase that cause that problem. I'm just curious how you was able to run that. thanks

  • @guilhermelirio
    @guilhermelirio 5 років тому +1

    Your video lessons are perfect !! I learn a lot from your didactics. Make more videos !! Thank you!

    • @increadibleangel7980
      @increadibleangel7980 5 років тому

      snapshot.data.length in the itemc
      ount does not work: "The gtter 'length' was called on null

    • @mdtouseefraza3458
      @mdtouseefraza3458 5 років тому +1

      @@increadibleangel7980 You should check that your snapshot has data or not.
      if(snapshot.hasData){
      then return this widget.
      }
      else{
      return this widget.
      }

    • @increadibleangel7980
      @increadibleangel7980 5 років тому

      @@mdtouseefraza3458 ok

  • @johnbobymesadieu8922
    @johnbobymesadieu8922 3 роки тому

    Awesome video! Thank you, Sir!

  • @loitafoundation4745
    @loitafoundation4745 3 роки тому

    Thx for the amazing vid. The important part is the last section. U should have expand it longer or explain that first, otherwise some people like me find it boring.

  • @vineet_kishore
    @vineet_kishore 6 років тому

    The quality of your videos are amazing so kindly make more videos covering more topics.

  • @christianlevels3049
    @christianlevels3049 5 років тому

    Absolutely amazing explanation of Flutter Firebase integration

  • @erperejildo
    @erperejildo 5 років тому +3

    If you have dynamic documents you need to listen I'd recommend to use StreamBuilder instead of FutureBuilder

    • @tint2483
      @tint2483 4 роки тому

      why, can you please explain ?

    • @erperejildo
      @erperejildo 4 роки тому

      @@tint2483 FutureBuilder = callback
      StreamBuilder = observer

  • @columbus2022
    @columbus2022 3 роки тому

    Awesome and best flutter video. 😊

  • @gopalbharadva9623
    @gopalbharadva9623 4 роки тому

    1 number bhai , very good explaination, 💙 se thanks.

  • @devgirl8968
    @devgirl8968 5 років тому

    amazing tutorial..new subscriber here...i'm new to flutter and all..and i'm learning a lot from you.thank you

    • @aragonite8052
      @aragonite8052 4 роки тому

      how did he made the documents in firestore. Who will teach that?

  • @Winner4ever
    @Winner4ever 6 років тому +6

    I was wondering why you didnt use the StreamBuilder

  • @FlutterTutorial
    @FlutterTutorial 3 роки тому

    very nice explanation

  • @ozgurdede6787
    @ozgurdede6787 4 роки тому

    Thanks brother , it helped me a lot you can't imagine :)

  • @MohamedAlsaee
    @MohamedAlsaee 4 роки тому

    You really awesome man 🙏❤ i wish you all the luck and all the success .

  • @Roman10-6
    @Roman10-6 Рік тому

    very usefull,
    please make more tutorial,
    thats awaresome

  • @veyselkaya9655
    @veyselkaya9655 5 років тому

    Thank you so much. A great example

  • @faizansalam
    @faizansalam 3 роки тому

    Your video is very usefull thank you buddy

  • @hubbataufique498
    @hubbataufique498 4 роки тому

    Amazing video. i have a question how we can add scroll bar in list view builder

  • @codeaxen
    @codeaxen 6 років тому

    Samarth Agarwal Thanks for your Videos Have Benefited a lot... being inspired by your Videos Happen to have created a channel

  • @MrCyKaOWN
    @MrCyKaOWN 4 роки тому +2

    The getter 'length' was called on null.
    Receiver: null
    Tried calling: length
    i entered firebase and it is connected, but it says they are empty ... how

    • @mateusflores9975
      @mateusflores9975 4 роки тому

      i have the same error, did u fix it?

    • @MrCyKaOWN
      @MrCyKaOWN 4 роки тому

      @@mateusflores9975 try adding a if(connectionState == connectState.loading){
      return Text(‘No connection’) } else { return ListView like this , because the length hasn’t gotten from the firebase and it’s null and it doesn’t have time to execute

    • @MrCyKaOWN
      @MrCyKaOWN 4 роки тому

      @@mateusflores9975 I have already fixed it , u need an if else state beforehand

    • @mateusflores9975
      @mateusflores9975 4 роки тому

      @@MrCyKaOWN thanks bro, i'll try.

    • @khalidmohd4932
      @khalidmohd4932 4 роки тому

      @@MrCyKaOWN where do i put this

  • @randycarrero6653
    @randycarrero6653 3 роки тому

    im having a huge time following along since i get errors way earlier and only get nulls and length problems

  • @malizupra
    @malizupra 4 роки тому

    You save my days..thanks!

  • @elsonxcode
    @elsonxcode 4 роки тому

    You're the best. thank you very much

  • @andrewvillegas122
    @andrewvillegas122 4 роки тому

    @Samarth Agarwal thank you for this amazing tutorial! Just in time when I needed it :)
    Quick question-- now that I go this to work, how can I incorporate all these calls using models?
    I've heard it can be more organized this way and more efficient.
    What'a a good place to start using models with Cloud Firesotore?
    1000% grateful!

  • @aaselab
    @aaselab 4 роки тому

    @Samarth Agarwal. Can you make a tutorial about how we can add search functionality to this project. If you can't, do you know is there other tutorial video that I can follow to add search function. Thank you

  • @borisvanleuven6233
    @borisvanleuven6233 4 роки тому

    Thnx for making this tutorial!!!

  • @khalidmohammed8841
    @khalidmohammed8841 4 роки тому

    Hi can i use streambuilder or do i have to use futurebuilder??

  • @ghostfreakali06
    @ghostfreakali06 5 років тому

    Brilliant work.

  • @MrPalbi
    @MrPalbi 5 років тому

    Hi, very nice. thank you. just a question, why MyHomePage is stateful rather than stateless?
    thank you

  • @slither366
    @slither366 6 років тому

    This lection is amazing, you are great friend :)

  • @juniorcastro1612
    @juniorcastro1612 4 роки тому

    Thx for this video. I create a textfield for search, but i can't put to work.
    Can u help me pls?

  • @faizansalam
    @faizansalam 3 роки тому

    Hey Samarth I am using a bottom navigation bar and everytime i switch tabs the page reloads do you know any way by which i can stop it from reloading the pages?

  • @kaouthergacem8135
    @kaouthergacem8135 2 роки тому

    great tutorial but I had a lot of errors:
    The operator '[]' isn't defined for the type 'Object' when trying to display the title of the post on the details page I solved it by casting "as DocumentSnapshot".
    I also changed the type Snapshot to AsyncSnapshot because it was throwing an error.

  • @melonpun
    @melonpun 5 років тому

    Thank a lot for the great video brother. I am new to programming and I have just started using Flutter. I have a question, I am planning to make a photo gallery app that has a main category and each main category segues to subcategory and then each subcategory segues to a list of images. Can I do that using firebase? And if you may, can provide with me tips please?

    • @thesamarthagarwal
      @thesamarthagarwal  5 років тому

      Yes. Sure you can do it with Firebase. Use Firebase Storage for storing images, get the URL and save the URL in a document. One document per image. In the same document, store information like category, tags and whatever you want.

  • @mlgen7
    @mlgen7 4 роки тому

    Thanks for the tutorial.
    I wanted to expand this and had a question.
    Q. I have a DB with data like ID, Name, Desc and Location. Where I wanted to categorise the returned collection into a different location.
    Ex: 1, test, testDesc, USA
    2, test2, testDesc, Mexico
    13 test3, testDesc, USA
    Once the _data (a Future) gets the data. Can it be managed into Lists of Array? Any suggestions here, please.

  • @siddhantagarwal6649
    @siddhantagarwal6649 6 років тому

    Very good and keep it up bro.....

  • @prajaktpatil1
    @prajaktpatil1 4 роки тому

    This is a good example. I want to know that how we authenticate with the email and password. and another question is that how we can show the list per user (means the different users may have the different lists)?. can you please guide regarding with..?

  • @frankbanini8884
    @frankbanini8884 6 років тому

    Flutter screens on github, thanks for sharing

  • @AtheGomez
    @AtheGomez 4 роки тому

    Hi!
    Please, how to check if a snapshot already exists in the firestore? we have a big mistake when the data is empty (null)

  • @simransingh1507
    @simransingh1507 6 років тому

    Great Work Bro !

  • @parwandaha3091
    @parwandaha3091 5 років тому

    what if I have a subcollection within each post on my firestore data base, lets say "relatedposts"? how do I query each post so that when navigating to the details page, the subcollection data should also show up?

  • @mehuljain7267
    @mehuljain7267 5 років тому

    This is amazing. I have one doubt though - I am working on a notes app and when I create a new note, firestore generates a random id to store it. But when I access it back, I want it to remain at top but instead it gets somewhere in the middle. How to fix this?

  • @Escalator0921
    @Escalator0921 4 роки тому

    How do I search and filter the listed items, sir? Can you help with that please?

  • @aditikumar6786
    @aditikumar6786 4 роки тому

    Current state of connection to the asynchronous computation.
    'connectionState' can't be used as a setter because it's final.
    Try finding a different setter, or making 'connectionState' non-final.
    plss help....

  • @ndragonxkarnovx4286
    @ndragonxkarnovx4286 6 років тому +1

    Anyone get this error after trying to use firestore --> library
    com.google.android.gms:play-services-base is being requested by various
    other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1

  • @SuperAnkursaini
    @SuperAnkursaini 4 роки тому

    Thanks

  • @pluckcitizen
    @pluckcitizen 6 років тому

    Is it possible to do a ListView of all fields in a DocumentSnapshot without knowing the field names?

  • @raghav4296
    @raghav4296 6 років тому

    Thanks Samarth. Is it possible to share the above code in your github account? Thanks for your super cool FlutterScreens and your effort to share your knowledge. Much appreciated!

  • @hashem_nayra
    @hashem_nayra 4 роки тому

    If any one had an error like: length is null,
    the error is in the Firebase rules! You just needed to change it from " read, write if false; " to " read, write; "
    Though, this is not secure! You just use this for testing proposes, if you are going to deal with the real world and publishing you app, please consider reading the "Firebase rules documentation" first! ..
    Hope this help! =)

  • @laptrinhwindowsform
    @laptrinhwindowsform 3 роки тому

    Thanks 😍

  • @innovafrique
    @innovafrique 6 років тому

    Good video, thx a lot. Can you show the name or the avatar image for the user who post the post your are using??? because I see that in post collection your are using owner with a id. please help me a have that problem

  • @vlycie6628
    @vlycie6628 4 роки тому

    I just subscribed to this channel..great content.. i have a question . How can I make the detail page be like a pageview scroll to left or right?

    • @thesamarthagarwal
      @thesamarthagarwal  4 роки тому +1

      Put the PageView on the detail page. You can use a PageViewController to set the default page of the PageView.

    • @vlycie6628
      @vlycie6628 4 роки тому

      ​@@thesamarthagarwalwould it be another call from firestore to have the detail page list for horizontal scroll?
      If it's not too much for you..will you please put out a tutorial about it? Thank you in advance 😊❤️

    • @thesamarthagarwal
      @thesamarthagarwal  4 роки тому +1

      @@vlycie6628 if you have that data, then you can pass it to the detail page (saving the call) but if you don't have it, you will have to make an extra call to get that data.

    • @vlycie6628
      @vlycie6628 4 роки тому

      @@thesamarthagarwal yes i've done it. Thanks ❤️
      But I can't seem to have this: I click on the listview item(item 1), i land on the detail page(detail of item 1), still on the detail page of item 1, I swipe to the left to go to the detail page of item 2.
      can't seem to find solution online

  • @vinit_poojary
    @vinit_poojary 4 роки тому

    I am getting an error before list display error - NoSuchMethodError: The getter 'length' was called on null . is this because of await this error only shows for a second any idea how can I avoid it

  • @hamzadaiz9002
    @hamzadaiz9002 4 роки тому

    thank you very much !!!!!!!!!!!

  • @venkatashish2219
    @venkatashish2219 4 роки тому

    Amazing video Samarth. In detailPage, instead of having a container in "body" I am trying to call a class which takes an argument. And I am sending the argument as widget.post.data["some key"]. But when I am trying to use the sent value in the class I am getting value as null. Can you help me with this.

  • @pranavsheth2406
    @pranavsheth2406 2 роки тому

    The operator '[]' isn't defined for the type 'Object? Function()'.
    sir i am having this error while getting data in detail page in title or in subtitle what can i do?

  • @adarshjaiswal6177
    @adarshjaiswal6177 4 роки тому

    how to fetch data from firestore to an product list models then display in list view widgets instead of directly fecthing it from firestore

  • @nanangkho9378
    @nanangkho9378 4 роки тому

    How to implement with search bar. ?

  • @florianrohrauer9626
    @florianrohrauer9626 6 років тому +2

    snapshot.data.length in the itemcount does not work: "The gtter 'length' was called on null". Help please :3

    • @tuelimishane
      @tuelimishane 6 років тому

      Were you able to fix this issue?

    • @garethtaufao
      @garethtaufao 6 років тому

      I get the same error as well

    • @tuelimishane
      @tuelimishane 6 років тому

      @@garethtaufao Check your firestore Rules. My firestore rule was denying permission to read my data. So I changed the Rules to:
      allow read;
      allow write: if false;

    • @garethtaufao
      @garethtaufao 6 років тому

      @@tuelimishane thanks did it work for you? I'll give it a try.

    • @tuelimishane
      @tuelimishane 6 років тому

      @@garethtaufao yes it did

  • @paulogorenstein770
    @paulogorenstein770 5 років тому

    Could you give me some lesons of Provider, stream, to provide querysnapshots?

  • @firaskudsy
    @firaskudsy 6 років тому

    if we move the getPosts() in the initState we will not get an updated collection .. in case we add a document while the app is running

    • @thesamarthagarwal
      @thesamarthagarwal  6 років тому +1

      True. For that you should subscribe to the snapshots() and use a StreamBuilder instead. Using the FutureBuilder with the future that calls Firebase directly is exhaustive and in real apps, will result in huge Firebase bills.

  • @codewithaustin
    @codewithaustin 4 роки тому

    how to update the firestore field data from the Application. Please answer quick

  • @MaddGuss
    @MaddGuss 5 років тому

    Awesome man! Can you make a video with compound queries please??

  • @ugurkorkmaz7968
    @ugurkorkmaz7968 5 років тому

    Problems may arise as a result of updating packages sometimes.
    Future getPosts() async {
    var firestore = Firestore.instance;
    Query q = firestore.collection('post');
    QuerySnapshot querySnapshot = await q.getDocuments();
    return querySnapshot.documents;
    }

    • @vinit_poojary
      @vinit_poojary 4 роки тому

      await is causing problem at the start it gives null for length

  • @shivamagarwal7623
    @shivamagarwal7623 6 років тому

    at the end of this video you explain how to stop your listview.builder to rebuild after navagating to next pange .....can you do this for stram builder its rebuilding everytime ..................

  • @abdulrhmanishag1595
    @abdulrhmanishag1595 5 років тому

    How can i Display json data using GridView

  • @4747477474744774
    @4747477474744774 5 років тому

    NIce Work

  • @jaypatel6770
    @jaypatel6770 3 роки тому +2

    THIS PART IS NOT WORKING Firestore.instance and return qn.documents gives error please help
    Future getFaculty() async {
    var firestore = Firestore.instance;
    QuerySnapshot qn = await firestore.collection("faculty").getDocuments();
    return qn.documents;
    }

  • @TheFatlifter285
    @TheFatlifter285 6 років тому

    how to check if a snapshot already exists in the firestore?

  • @nimalviju196
    @nimalviju196 5 років тому

    Nice ...

  • @aragonite8052
    @aragonite8052 4 роки тому

    I am getting an error as The getter length was called on null. Somebody tell me what to do.

  • @roebenhood
    @roebenhood 4 роки тому

    How to show specific data/post?

  • @arsenemwape9593
    @arsenemwape9593 6 років тому

    how to get next value on master detail page ?

  • @shubhamarora547
    @shubhamarora547 6 років тому

    Sir please make video on angular 6 and seperate video on firebase

  • @GrantImbo
    @GrantImbo 5 років тому

    Hey guys, come someone please help me? I have the same setup as this. However, I want to add a feature to sort the post list.
    My setup goes like this... I have a separate ListView (vertical) which is the categories. Now when a user clicks this, I want to sort the post list. Can someone please help me?

  • @jeda874
    @jeda874 5 років тому

    Hi Samarth, thanks for sharing this video, i use your code in my app. How to apply Searchdelegate in this project? Hope you can help me.

  • @Sachin-ry7sd
    @Sachin-ry7sd 4 роки тому +1

    Anybody please help me
    I/flutter (10297): The following NoSuchMethodError was thrown building FutureBuilder(dirty, state:
    I/flutter (10297): _FutureBuilderState#fc53c):
    I/flutter (10297): The getter 'length' was called on null.
    I/flutter (10297): Receiver: null
    I/flutter (10297): Tried calling: length

    • @vinit_poojary
      @vinit_poojary 4 роки тому

      I got the same error I think it because of await

  • @tuelimishane
    @tuelimishane 6 років тому

    I am getting an error "Getter length was called on null" at itemCount: snapshot.data.length,. any idea?

    • @ugurkorkmaz7968
      @ugurkorkmaz7968 5 років тому

      Future getPosts() async {
      var firestore = Firestore.instance;
      Query q = firestore.collection('post');
      QuerySnapshot querySnapshot = await q.getDocuments();
      return querySnapshot.documents;
      }
      Just fix this

  • @prashantgandhi8822
    @prashantgandhi8822 6 років тому

    How can I pass the firebase database from one screen to another screen ?

    • @thesamarthagarwal
      @thesamarthagarwal  6 років тому

      Sorry, I did not understand. Can you please explain your question?

    • @prashantgandhi8822
      @prashantgandhi8822 6 років тому

      I make an app in flutter and backend use firebase real time database......so I fetch the data on home screen(in ListView) then I want to send particular selected data(select from listview) on next screen
      @@thesamarthagarwal

  • @wahyukuncoro6721
    @wahyukuncoro6721 5 років тому

    how to show owner data in list? please help me

  • @ThanhNguyen-xg7un
    @ThanhNguyen-xg7un 5 років тому

    Great tutorial! Really love it!
    Which code should I write to get this list sorted?

  • @gnappo3000
    @gnappo3000 4 роки тому

    but the serialization?

  • @zubairayazasim5187
    @zubairayazasim5187 3 роки тому

    can you share the code of this tutorial?

  • @innovafrique
    @innovafrique 6 років тому

    Good

  • @sherryacademy6795
    @sherryacademy6795 5 років тому

    THANKS

  • @AndresAngelo
    @AndresAngelo 5 років тому

    Here is the first part codigo of the code, I am getting an error " the getter length is called null"
    import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: ListUsers(), // ); } } //WIDGET 1 class ListUsers extends StatefulWidget { @override _ListUsersState createState() => _ListUsersState(); } class _ListUsersState extends State { Future getUsers() async { var firestore = Firestore.instance; QuerySnapshot qn = await firestore.collection('users').getDocuments(); return qn.documents; } @override Widget build(BuildContext context) { return Container( child: FutureBuilder( future: getUsers(), builder: (_, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return Center( child: Text('LOADING...'), ); } else { return ListView.builder( itemCount: snapshot.data.length, itemBuilder: (_, index) { return ListTile( title: Text(snapshot.data[index].data["email"]), ); }); } }), ); } } //WIDGET 2 class DetailUsers extends StatefulWidget { @override _DetailUsersState createState() => _DetailUsersState(); } class _DetailUsersState extends State { @override Widget build(BuildContext context) { return Container(); }

  • @gilmcglory3748
    @gilmcglory3748 6 років тому

    Thanks for this very instructive Flutter tutorial. I subscribed to your Udemy "Ionic 3 Apps for WooCommerce" course. Is there any chance of you doing a Udemy "Flutter Apps for WooCommerce" course?

    • @thesamarthagarwal
      @thesamarthagarwal  6 років тому

      Thank you Gil. I am thinking about it now because a lot of wonderful people have reached out to me regarding that. I will keep everyone posted about it.

  • @whitetiger3987
    @whitetiger3987 4 роки тому

    yapamadım hocam...

  • @AndresAngelo
    @AndresAngelo 5 років тому

    no working, errors

  • @aragonite8052
    @aragonite8052 4 роки тому

    I doubt anyone has actually tried making this app. Because I got an error and I don't understand how in this video everything just worked fine. Similarly, one more video of this channel I was getting error but these videos don't show any error I don't know how!!!!