Тёмный

(Ep 54) Search List View With Flutter & Firestore 

1ManStartup
Подписаться 14 тыс.
Просмотров 30 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 80   
@ithelp5893
@ithelp5893 3 года назад
Wow man, you are the best. I really like the way you explain things. I have learned sooooooo many things from you.
@lynnyserbyt3607
@lynnyserbyt3607 3 года назад
Great tutorial!!! I finally got a working search bar! Thanks! Now... on to the next hurdle...
@hussnainmehdi3629
@hussnainmehdi3629 Год назад
Thank you so much for such very helpful video and content.
@igortrapp30
@igortrapp30 3 года назад
This is exactly what I was looking for, excellent explanation, very clear.
@77558
@77558 Год назад
This is ok for small databases. But imagine You want to search a user database with millions of entries. You first have to download all of them and then filter out those that matches Your search criteria. Way too much traffic! But there is no solution - as I belive - because firebase has no direct WHERE text %LIKE% or contains functionality like any SQL db since decatdes. Also startsWith() and endsWith() is too slow. And this is unfortunatley a dealbreaker ofr using firebasew for me. :(
@fatemakhalfan6980
@fatemakhalfan6980 2 года назад
This made my life easier, thanks a lot
@1ManStartup
@1ManStartup 2 года назад
Glad to hear that!
@Oalone
@Oalone Год назад
Thankyou you helped me a lot
@1ManStartup
@1ManStartup Год назад
Glad to hear that!
@anuragthakur3813
@anuragthakur3813 2 года назад
Thank you very much man You saved me
@1ManStartup
@1ManStartup 2 года назад
Glad to help!
@breadman7733
@breadman7733 4 года назад
The video i've been waiting for, awesome stuff!
@1ManStartup
@1ManStartup 4 года назад
Glad to hear that!
@webertherik9865
@webertherik9865 Год назад
Thanks bro!!😎
@vidyasystems7768
@vidyasystems7768 2 года назад
Thanks a Lot Dear..............
@Theshamsham00
@Theshamsham00 2 года назад
This guy is amazing !
@1ManStartup
@1ManStartup 2 года назад
appreciate it!
@prolegend26539
@prolegend26539 4 года назад
Thank you for this tutorial! What if you would like to have access to the data (that you fetch from firestore) in a different tab? I am trying to use the Provider package to solve this (by moving the functionality of fetching data from firestore to a separate class). In your example, you set the firestore data to a List. On the other hand, I am not able to use the Consumer widget from Provider because it requires to return a widget; I guess the assumption is that you are supposed to use it when building your UI in the build function. But we have our data in a list, which is not a widget. I am totally lost. Would you have any tips on how to come around this problem?
@1ManStartup
@1ManStartup 3 года назад
There are a few ways you can do this and I'm not sure which is best, especially because different app types could benefit from different ways. My initial thought is to load that data wherever you are setting up the tab bar. this is where I am github.com/davefaliskie/travel_budget/blob/master/lib/views/navigation_view.dart so for example you could probably load that data here then pass it to each of the views (lines 18-20) I do think storing in the provider would be best. In my app I don't use the provider package but rather a InheritedWidget called Provider (I know confusing, I shouldn't have done that) github.com/davefaliskie/travel_budget/blob/master/lib/widgets/provider_widget.dart but look into InheritedWidget as well that could solve your problem. also just loading it on the first page and passing the data between views is an option, although that could get messy depending on how big your app is. that concept is kind of shown here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IxCeJS9yA8w.html (but for a different context, and not really what you want) and now that I think of it wouldn't really work with tabs. good luck!
@MagicClayRock
@MagicClayRock 3 года назад
Helped me a lot, thank you :)
@1ManStartup
@1ManStartup 3 года назад
You're welcome!
@sageat1242
@sageat1242 2 года назад
hey, how can we perform the same operation for realtime database?
@Himricks
@Himricks 3 года назад
Hi dave ! Can you make video on searching with aws amplify as a backend plz i don't find much sources on youtube, you are the only guy who can help me with these i guess, plz make one video on it.
@1ManStartup
@1ManStartup 3 года назад
Not a bad idea, I know little about Amplify I'll check it out and try to make a stand alone video/ introduction
@NaifChannels
@NaifChannels 3 года назад
Thank you! This helped me a lot
@1ManStartup
@1ManStartup 3 года назад
I'm so glad!
@ravindrametri1681
@ravindrametri1681 Год назад
how to add on tap on list to move to update screen , how to get document id
@TheBoredandCool
@TheBoredandCool 3 года назад
it really helped me, Thanks a bunch
@1ManStartup
@1ManStartup 3 года назад
Glad to hear that!
@wynsalvez5694
@wynsalvez5694 3 года назад
Thank you, this helped me lot, but i suggest to create a filter menu tutorial, it will be wonderful to do that
@1ManStartup
@1ManStartup 3 года назад
thanks for the suggestion, I'll add it to the list
@LLalex
@LLalex 3 года назад
Thanks!
@Himricks
@Himricks 3 года назад
What should I write inside the getusersnapshots function if I don't have firestore connectivity, and what should I write inside setstate() . Actually I followed your videos of creating list view of the trip,now I want to implement the search inside that. Should I write setstate() { _allresults = trip.title } If I want to search list by title. Is it right way? Plz help me!!
@1ManStartup
@1ManStartup 3 года назад
_allresults is simply an array of Trips. In the example I'm getting those trips from firestore. You don't need to use firestore, you could hard code trips into an array (that doesn't seem to useful tho), `setstate() { _allresults = trip.title }` doesn't make sense because then _allresults would be a single trips title.
@jbm1444
@jbm1444 3 года назад
Thank you so much for these videos. I have learned so much and they helped me a lot. Could you give me some general guidance on how to integrate your logic in this video with a filter that works with a DropDownMenu?
@1ManStartup
@1ManStartup 3 года назад
Probably I would start by getting the value of the dropdown and passing that into the search/filter function likely as another .where statement
@jbm1444
@jbm1444 3 года назад
@@1ManStartup Thank you very much!
@NoOne-vz2pb
@NoOne-vz2pb 3 года назад
One thing i don't get is when you change the search text field, you are adding to showResults, but the listviewbuilder uses _allResults.So how is updating showResults updating _allResults and thus making your search result work?
@1ManStartup
@1ManStartup 3 года назад
The list view builder should be using the _resultsList which is a list containing only the matching results form the larger _allResults list.
@tammodirksen1408
@tammodirksen1408 2 года назад
Great video, but does this allow changes in realtime? The benefit of stream builders are that they react to changes without manually refreshing. I need these real time changes.
@1ManStartup
@1ManStartup 2 года назад
No this won't refresh the data in real time. This concept pulls data initially and then filters it locally.
@tammodirksen1408
@tammodirksen1408 2 года назад
@@1ManStartup Thanks for your response! So you would need to implement some kind of „Pull to refresh“ to update your content? Thank you anyway!
@1ManStartup
@1ManStartup 2 года назад
@@tammodirksen1408 it depends, if your most concerned about the search results being real time then you could query the database on each search. If you want the list view to have new data pushed to it in real time a stream builder would be best. The stream builder setup can be found here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-BpDWo_fXQTI.html I view these as two separate problems, and maybe you need both solutions
@tammodirksen1408
@tammodirksen1408 2 года назад
@@1ManStartup I am using StreamBuilder right now (just like you did) and I pretty much want to filter the already loaded Listview when typing something in there. But I see: The options are pretty much: - SearchBar + StreamBuilder = Real Time Data but a ton of calls to Firestore or - SearchBar + the option in your video = No unnecessary calls to Firestore but also no real time data. I guess you can’t have real-time data and a search on already loaded data without making a lot of calls to Firebase. Thank you anyway! I guess I will have to make some sacrifices inside my app :)
@1ManStartup
@1ManStartup 2 года назад
@@tammodirksen1408 If you have the stream builder setup to keep some list updated on changes, then perform the search on that list it might work without any extra calls.
@denigunawan9936
@denigunawan9936 4 года назад
Good thanks , you save my time thanks alot
@1ManStartup
@1ManStartup 4 года назад
Glad to hear that
@섀플리
@섀플리 3 года назад
Hi, I have lists I typed in, like (listA = ['a', 'b', ...] ) instead of firestore data. What should be changed in code then?
@1ManStartup
@1ManStartup 3 года назад
go read my response to Himricks comments from earlier today, it's basically answered there
@mehmetedex
@mehmetedex 3 года назад
searching the local data is easy now do it for the serverside :)
@1ManStartup
@1ManStartup 3 года назад
🕵️‍♂️
@subconex
@subconex 4 года назад
well done, thanks!
@1ManStartup
@1ManStartup 4 года назад
😎
@DemsDema
@DemsDema 3 года назад
Great work done here. Is there a way to add more search keys?
@1ManStartup
@1ManStartup 3 года назад
yes building off this you could search by 2 different params & then join the results & de duplicate. depending on the number of parms and amount of data there are likely better ways to achieve this
@josuedeshagette1247
@josuedeshagette1247 3 года назад
HI Does it work with FLUTTER 2?
@parthdesai84
@parthdesai84 3 года назад
Hey! Can we use the same method for GridView?
@1ManStartup
@1ManStartup 3 года назад
yes it should work the same, if you haven't already tried
@Himricks
@Himricks 3 года назад
Instead of writing var title = Trip.fromSnapshot(tripsnapshot).title.toLowerCase(); what should i write if I want to search by list but i don't want to use fromsnapshot plz tell me I tried Using var title = Trip.title.toLowercase(); but it gives error plz help me !!!!!!!!!!!!!!!!!
@1ManStartup
@1ManStartup 3 года назад
Similar to my last comment, depending on what you have in your _allResults array it will determine how you search. for example if _allResults = ["one", "two", "three"] then title would just be equal to tripSnapshot (you should rename the variable if that's the case, this assumes you modifying this line) github.com/davefaliskie/travel_budget/blob/da33e8d7477598bf8407a0ec356e45ce897be786/lib/views/past_trips_view.dart#L49
@zippkush9887
@zippkush9887 3 года назад
Great video Dave, I have a question, where did the data.documents came from? Does it have to do something with document(uid)? As i get error there: The getter 'documents' isn't defined for the type 'Future'.
@1ManStartup
@1ManStartup 3 года назад
some syntax has changed w/ new versions of firebase packages I think it's data.docs now but this video covers it ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rmKvN1UCH9c.html
@aljoharaha6116
@aljoharaha6116 3 года назад
I have faced some errors, and I can’t solve it plz help me:(, when i used textField it said “textField widgets require a Material widget ancestor ... etc”
@1ManStartup
@1ManStartup 3 года назад
the error is telling you what you need... A material app
@NIKHIL27B
@NIKHIL27B 4 года назад
Nice
@1ManStartup
@1ManStartup 4 года назад
Thanks
@samario_torres
@samario_torres 4 года назад
I think your backend is eventually going to get too large..and the process you're implementing now won't scale..im facing this problem now with my app...I've decided to integrate algolia search...but the other will be helpful for sure i.e, not searching when the amount of letter is 0 or 1, etc
@1ManStartup
@1ManStartup 4 года назад
Depending on your app, yes this way of searching will not scale. This video specifically is only going to search Trips that belong to you, which I would never expect to get over a relatively low amount 50 would be A LOT for example. If you want throttling in your search I do show how that can be done in this video, maybe would be useful. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rJOkoAmC5GY.html
@jcswentr9059
@jcswentr9059 3 года назад
@@1ManStartup What would you say is the limit with this logic then? For example, would doing search this way scale well for 200 Trips?
@1ManStartup
@1ManStartup 3 года назад
@@jcswentr9059 hm hard to say for sure, I think 200 would probably still be okay. But I wouldn't build a search like this if I anticipated more than 50 documents. So for me 50 would be the max for this setup.
@jcswentr9059
@jcswentr9059 3 года назад
@@1ManStartup Okay thank you. If you were to build with circa 200 trips being common for users, would you use a StreamBuilder like before?
@khawajakhalil6168
@khawajakhalil6168 3 года назад
Murshiddd!! 🙏🏻🙏🏻
@1ManStartup
@1ManStartup 3 года назад
😎
@rasodemekontha8204
@rasodemekontha8204 3 года назад
Hello Sir, actually, I'm not getting the data from firebase. Here is what I have done here. var tutorialData = await FirebaseFirestore.instance.collection("tutorials").get(); setState(() { _allResult = tutorialData.docs; });
@kkriit
@kkriit 4 года назад
6:33 Firestore and getDocuments are deprecated !!!
@1ManStartup
@1ManStartup 4 года назад
yes, updates are shown in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rmKvN1UCH9c.html
@AbhideepChakravarty
@AbhideepChakravarty 3 года назад
Do a flutter build web. Then deploy the app somewhere. Then open the app in Android, on any browser. Try to do your search 3-4 times. Boom, it does not work.
@1ManStartup
@1ManStartup 3 года назад
This hasn't been tested for flutter web. I still don't think flutter web is ready for production.
@AbhideepChakravarty
@AbhideepChakravarty 3 года назад
@@1ManStartup It's in beta but text field getting weird is too much bad.
Далее
(Ep 55) Flutter: Upgrade Firebase Dependencies 2020
24:30
진 (Jin) 'I'll Be There' Official MV
03:15
Просмотров 6 млн
3 лайфхака для УШМ
01:00
Просмотров 149 тыс.
Team Spiderman True Or False Mask,nono #Shorts
00:37
iPhone Flip станет ХИТОМ!
00:40
Просмотров 387 тыс.
Search Bar in Flutter - Logic & Material UI
43:35
Просмотров 65 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Using Firestore as a backend to your Flutter app
11:42
Просмотров 525 тыс.
Go Has Exceptions??
16:58
Просмотров 66 тыс.
React Native vs Flutter - Which should you use?
22:31
Search Bar with Provider and API Call in Flutter
14:40
List Detail with Cloud Firestore in Flutter
16:00
Просмотров 65 тыс.
5 JavaScript Concepts You HAVE TO KNOW
9:38
Просмотров 1,4 млн
진 (Jin) 'I'll Be There' Official MV
03:15
Просмотров 6 млн