List Detail with Cloud Firestore in Flutter

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 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 5 лет назад

      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 😊

  • @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

  • @omarsharifrajme7061
    @omarsharifrajme7061 4 года назад

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

  • @loitafoundation4745
    @loitafoundation4745 2 года назад

    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.

  • @HarithaMadushankaharryze7
    @HarithaMadushankaharryze7 3 года назад

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

  • @mhmzdev
    @mhmzdev 5 лет назад +2

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

  • @Winner4ever
    @Winner4ever 5 лет назад +6

    I was wondering why you didnt use the StreamBuilder

  • @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

  • @benjamindeworsop8348
    @benjamindeworsop8348 4 года назад +1

    Incredible video - amazingly clear and beautifully designed! THANK YOU

  • @nazmulhayat9842
    @nazmulhayat9842 4 года назад

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

  • @johnbobymesadieu8922
    @johnbobymesadieu8922 2 года назад

    Awesome video! Thank you, Sir!

  • @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

  • @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

  • @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 4 года назад +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 4 года назад

      @@mdtouseefraza3458 ok

  • @columbus2022
    @columbus2022 3 года назад

    Awesome and best flutter video. 😊

  • @christianlevels3049
    @christianlevels3049 5 лет назад

    Absolutely amazing explanation of Flutter Firebase integration

  • @Roman10-6
    @Roman10-6 9 месяцев назад

    very usefull,
    please make more tutorial,
    thats awaresome

  • @vineet_kishore
    @vineet_kishore 6 лет назад

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

  • @gopalbharadva9623
    @gopalbharadva9623 4 года назад

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

  • @FlutterTutorial
    @FlutterTutorial 3 года назад

    very nice explanation

  • @codeaxen
    @codeaxen 5 лет назад

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

  • @MohamedAlsaee
    @MohamedAlsaee 4 года назад

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

  • @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?

  • @ozgurdede6787
    @ozgurdede6787 4 года назад

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

  • @hubbataufique498
    @hubbataufique498 4 года назад

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

  • @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

  • @randycarrero6653
    @randycarrero6653 3 года назад

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

  • @andrewvillegas122
    @andrewvillegas122 3 года назад

    @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!

  • @veyselkaya9655
    @veyselkaya9655 5 лет назад

    Thank you so much. A great example

  • @faizansalam
    @faizansalam 3 года назад

    Your video is very usefull thank you buddy

  • @malizupra
    @malizupra 4 года назад

    You save my days..thanks!

  • @mehuljain7267
    @mehuljain7267 4 года назад

    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?

  • @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! =)

  • @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

  • @elsonxcode
    @elsonxcode 4 года назад

    You're the best. thank you very much

  • @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.

  • @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.

  • @simransingh1507
    @simransingh1507 5 лет назад

    Great Work Bro !

  • @borisvanleuven6233
    @borisvanleuven6233 4 года назад

    Thnx for making this tutorial!!!

  • @siddhantagarwal6649
    @siddhantagarwal6649 6 лет назад

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

  • @slither366
    @slither366 5 лет назад

    This lection is amazing, you are great friend :)

  • @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?

  • @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)

  • @raghav4296
    @raghav4296 5 лет назад

    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!

  • @frankbanini8884
    @frankbanini8884 6 лет назад

    Flutter screens on github, thanks for sharing

  • @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?

  • @ndragonxkarnovx4286
    @ndragonxkarnovx4286 5 лет назад +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

  • @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.

  • @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 3 года назад

      @@MrCyKaOWN where do i put this

  • @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?

  • @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..?

  • @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....

  • @jaypatel6770
    @jaypatel6770 2 года назад +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;
    }

  • @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.

  • @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

  • @pluckcitizen
    @pluckcitizen 6 лет назад

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

  • @Escalator0921
    @Escalator0921 4 года назад

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

  • @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

  • @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

  • @khalidmohammed8841
    @khalidmohammed8841 3 года назад

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

  • @ThanhNguyen-xg7un
    @ThanhNguyen-xg7un 5 лет назад

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

  • @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?

  • @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 ..................

  • @MaddGuss
    @MaddGuss 5 лет назад

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

  • @shubhamarora547
    @shubhamarora547 6 лет назад

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

  • @paulogorenstein770
    @paulogorenstein770 5 лет назад

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

  • @codewithaustin
    @codewithaustin 4 года назад

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

  • @florianrohrauer9626
    @florianrohrauer9626 6 лет назад +3

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

    • @tuelimishane
      @tuelimishane 5 лет назад

      Were you able to fix this issue?

    • @garethtaufao
      @garethtaufao 5 лет назад

      I get the same error as well

    • @tuelimishane
      @tuelimishane 5 лет назад

      @@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 5 лет назад

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

    • @tuelimishane
      @tuelimishane 5 лет назад

      @@garethtaufao yes it did

  • @TheFatlifter285
    @TheFatlifter285 6 лет назад

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

  • @hamzadaiz9002
    @hamzadaiz9002 4 года назад

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

  • @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?

  • @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

  • @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.

  • @laptrinhwindowsform
    @laptrinhwindowsform 3 года назад

    Thanks 😍

  • @nanangkho9378
    @nanangkho9378 4 года назад

    How to implement with search bar. ?

  • @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

  • @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.

  • @4747477474744774
    @4747477474744774 5 лет назад

    NIce Work

  • @SuperAnkursaini
    @SuperAnkursaini 3 года назад

    Thanks

  • @arsenemwape9593
    @arsenemwape9593 6 лет назад

    how to get next value on master detail page ?

  • @abdulrhmanishag1595
    @abdulrhmanishag1595 5 лет назад

    How can i Display json data using GridView

  • @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

  • @roebenhood
    @roebenhood 4 года назад

    How to show specific data/post?

  • @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.

  • @wahyukuncoro6721
    @wahyukuncoro6721 5 лет назад

    how to show owner data in list? please help me

  • @tuelimishane
    @tuelimishane 5 лет назад

    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

  • @zubairayazasim5187
    @zubairayazasim5187 3 года назад

    can you share the code of this tutorial?

  • @AndrewProjectos
    @AndrewProjectos 4 года назад

    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(); }

  • @prashantgandhi8822
    @prashantgandhi8822 5 лет назад

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

    • @thesamarthagarwal
      @thesamarthagarwal  5 лет назад

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

    • @prashantgandhi8822
      @prashantgandhi8822 5 лет назад

      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

  • @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!!!!

  • @innovafrique
    @innovafrique 6 лет назад

    Good

  • @gnappo3000
    @gnappo3000 4 года назад

    but the serialization?

  • @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.

  • @sherryacademy6795
    @sherryacademy6795 4 года назад

    THANKS

  • @whitetiger3987
    @whitetiger3987 3 года назад

    yapamadım hocam...

  • @arsenemwape9593
    @arsenemwape9593 6 лет назад

    what next ?