Flutter Fetch Data from Firebase | Fetch and Display Products on Grid
ฝัง
- เผยแพร่เมื่อ 18 ธ.ค. 2023
- In this comprehensive Flutter tutorial, we unlock the potential of Firebase to seamlessly fetch products and dynamically display them on a grid in your Flutter app.
► Complete E-Commerce App Playlist : • Professional Flutter E...
🎊 E-COMMERCE APP
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🎁 DOWNLOAD SOURCE CODE: codingwitht.com/product/flutt...
❤️ FLUTTER E-COMMERCE APP PLAYLISTS
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Complete E-Commerce App : • Professional Flutter E...
► Section - 1 Configuration : • Professional Flutter P...
► Section - 2 Login App : • Professional Flutter P...
► Section - 3 eCommerce UI : • Flutter Complete Ecomm...
► Section - 4 Login Backend: • Flutter Firebase Cours...
► Section - 5 eCommerce Backend: • Flutter E-Commerce App...
❤️ SUBSCRIPTIONS
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Join Patreon to Access Premium Content: / membership
COURSES
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► FLUTTER CRASH COURSE • Flutter Crash Course f...
► LOGIN APP FIREBASE • Flutter Login App - UI...
🧑💻 RELATED VIDEOS
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Home Screen Design(categories): • Search Bar and Horizon...
► Tab Bar Design : • TabBar in Flutter with...
► GetX Basics: • Flutter Firestore CRUD...
CHAPTERS
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
00:00 Introduction
FOLLOW US ON SOCIAL MEDIA
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
💻 Facebook | / codingwithtea
💻 Instagram | / coding_with_tea
Here's a detailed breakdown of what we'll cover:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Join Coding with T in this comprehensive Flutter tutorial, where we unlock the potential of Firebase to seamlessly fetch products and dynamically display them on a grid in your Flutter app. Whether you're a Flutter enthusiast or an experienced developer, this guide is tailored to optimize your app's performance and enhance the visual representation of your products.
📖 Video Overview:
Introduction: Immerse yourself in the world of dynamic app optimization as we leverage Firebase to fetch products and create visually appealing grids in Flutter.
Tutorial Breakdown: Dive into a detailed breakdown of each step, ensuring a comprehensive understanding of product retrieval and dynamic grid display.
🔍 Key Tutorial Insights:
Fetching Products from Firebase: Master the Flutter coding process to dynamically fetch products from Firebase, streamlining your app's data retrieval.
Dynamic Data Display on Grid: Learn how to seamlessly showcase products on a grid, providing an optimized visual representation for users in your Flutter app.
👩💻 What You'll Learn:
✔️ Fetching products from Firebase in Flutter for streamlined data retrieval.
✔️ Creating dynamic grid displays to visually showcase products in an optimized layout.
🌟 Why Watch?
Whether you're a Flutter enthusiast or a developer seeking to optimize your app's visual representation, this tutorial provides actionable insights for product fetching and dynamic grid displays. Subscribe, like, and hit the bell icon for more app optimization tutorials from Coding with T!
#FlutterFirebase #ProductFetching #FirebaseOptimization #FlutterGridDisplay #FirebaseTutorial #FlutterTutorial #OptimizeFlutterApp #CodingWithT #VisualRepresentation - วิทยาศาสตร์และเทคโนโลยี
Absolutely fantastic tutorial! 🚀 Your step-by-step guide on fetching data from Firebase and displaying products on a grid in Flutter is incredibly helpful and well-explained. 👏 The clarity of your instructions made it easy for me to follow along and implement the same in my project. Thank you so much for sharing your expertise! 🙌 Looking forward to more insightful Flutter tutorials from your channel. Keep up the excellent work! 🌟 #FlutterDevelopment #FirebaseMagic #GratefulViewer
You're very welcome! 😊
Hey Taimoor, excellent tutorial like always although I have some problems with the first part of the video how am I supposed to add that dummy data in every document, like everytime I add a new document I have to retype the field names isn't there a more sufficient way of doing it?
Thank you💯💯💯💯💯
in which video you created brand models?? i'm having errors
I got error String is not subtype of bool and I don't know what cause this code is same as yours
I really like the way you’re explaining every bit of the code I really appreciate that ❤
But please can i ask where can i download dose animation you used on the onboarding screen so that i can use a different one and please can you make a video on how to insert form data in firebase am new in app development 🙏🙏
I really appreciate your work here and i can’t for the next video to drop
Thank you for your support and Love.
To upload foam data you should watch the section 4 video in which we already stored user data received from the foam.
@@CodingwithT thank you for your reply. i know about that part but how can i add images to it
u can store images in firebase storage and then assign url to your variable userProfile. For further details please watch the tutorial again.
i think better to use json then import it to firebas then it will convert to colletion this way faster
Very good! I met an issue. In the previous tutorial when I ran and clicked on one of my banners it redirected to the concerning page but the app bar disappeared!
You are right and the reason is that you use simple redirect but if you are using Bottom Navigation then you must call your Menu Class and pass the index in order to have bottom navigation
@CodingwithT Okay thank how to do this??
Are you implementing notifications?
I will try
@@CodingwithT please notifications must
Brother all videos are so much interactive. You will create admin module right bro??
Yes I will
Hi thanks for this tutorial, how can i add more collection at home screen like (men product horizontal) (women) (best seller) (new arrivals) did i create model screen and controller and repository for each collecthion?
You welcome,
In order to achieve that, you do not have to create any collection rather add a new keys in that same product collection like productFor Gents or Ladies?
You can get new arrivals using Date.
For the best Sellers you have to keep count of each product sale and then show much sold once.
@@CodingwithT Thanks for your reply but you didn't explain how to present them to home screen how can i show collection 1 by 1 on main home screen there only a grid view for example i want create horizontal for each collection
@Jack-xp9qp Just reuse that grid view again with new data.
Just change the query to fetch your data
You didn't show how to create products collections in firebase pls let me know how to make that part could you pls explain iam confused
what statement widget you using (bloc or getx or provider )?
We are using Getx but you can use any state management technique 😊
how its difficult please give me step or (how to do that ) to achieve this concept @@CodingwithT
If you want to follow this state management (GetX) you just have to follow the tutorials.
If you want to go for some other state managements you can create the design and as a back-end use other state managements.
Please i'm getting error null check operator used on null value. the relevant error causing widget was TProductCardVertical. please help me
the error comes from product controller.getProductPrice. the null operator used in productVariations is causing my app to crash please help
To resolve the "null check operator used on null value" error in your TProductCardVertical widget, you should handle null values in your model's property. Using the null-aware operator (??) as you suggested is a good approach. for example if your property is description then you will use as description: data['Description'] ?? '', if the data is integer then price: double.parse((data['Price'] ?? 0.0).toString()),
bro you fixxed it is error?
I swear to god last night I dream about this video 🤗
So nice of you @Suleiman and thank you for your love and support 💗
Sir, I followed your video step by step to write code to get here !!!😉 But I'd like to know how to get DummyData here, and can you provide a copy? Thanks again 🙏
exactly, we need a DummyData class.
hey the dummy data file isn't in source code. could you keep the file in Source Code?
@PrathamMakwana-wr5lv
0 seconds ago
hey any one done with the app. Please Provide The githhub repository link so we can refer it and the upload section code to upload in the firestore
hello sir I love your training but I encountered a difficulty in the video you did not show how you did to insert the image url in firebase so that it is displayed locally. please I need help thanks for the advance
I've created a tutorial about the user profile picture to upload and use the url to show the image.
@@CodingwithT ok sir thanks
@PrathamMakwana-wr5lv
0 seconds ago
hey any one done with the app. Please Provide The githhub repository link so we can refer it and the upload section code to upload in the firestore
Hi, my name is Abdul Rehman from Pakistan, hope you are fine,
I want need your help . Dummydata are Not uploading on Firestore and Firebase Storage. Please confirm me. Are you implement Dummydata on project.
Message Coding with T on WhatsApp. wa.me/447456285429
While uploading dummy data, Only Variable Product Type product is stored in the firebase. Kindly help me
I’ll show the upload part in the admin panel Course which will be started from the next week on Patreon. Stay tuned
Where can I get the link to follow you?@@CodingwithT
I don't know Sir but to save Brand data in each item its make me confused , do you think its good approach? Please guide me, why we don't make Brand Model and linked it to the item this is not Wasted Database size , and no duplicated in the data , even for ProtectAttributes we make ProtectAttributes Model and save All averrable Attributes there and link what we need to the item model by saving Attributes Id as will as ProtectVariations , what you think Sir
Excellent question ❓.
The reason is that Firebase doesn't care about data duplication rather focused on speed and also Firebase charges are based on No of document reads and writes. Not like SQL which usually depends on the Size.
So we know 90% of the time brands never change anything in their data that's why we added everything in one document
@@CodingwithT Hello Sir , Maybe I Agree with you , but honestly because I'm come From SQL Database background this is make me don't accept that , for example if one of this brands or any other joint model data changed do you know this is disaster , if you have app with Thousands of items , you can imagen the admin feeling , honestly I don't accept this I put each model suppurated , and when fetch the data I link it together so every time data loaded take the changes in joint models
thanks sir but i still have probleme when i run my the populaire product shows me message ''no data found' and when i go to see all i found erreur messagen 'null check operator used on all value '
I have the same problem as you, have you solved it yet? Please let me know
@@Chien-ie2cy no not yet sorry
It seems like you're encountering a null check operator issue in the vertical card product file. To address this, you can use the null-aware operator (??) in your model.
For instance, in the model file, where you're accessing the description data, you can use:
description: data['Description'] ?? ' ',
This ensures that if the data['Description'] is null, it'll default to an empty string, preventing null-related errors.
Let me know if you need further clarification or assistance!
how to add category image i face a unable to load asset in category please reply
You have to add image like I added profile screen image in Profile Video.
i am getting null is not a subtype of type List in a cast and on screen no data found
me too
please how did you solve this problem, i am facing it too
me too
@@aladdinsonni Hello, did you manage to solve the problem?
@@anashomaid144 Hello, did you manage to solve the problem?
Plz can you finish jt faster? Like before new year? Much Love ❤❤❤
Will be completed by the end of this week or next week
"Null check operator used on a null value"
products do not load from Firebase and shows an error in brand!
tell me how to fix it. Please
HomeScreen shows "No Data Found!"
This means you are accessing string and assigning it to the String variable, but null is being assigned to that string.
Probably it happens sometimes when accessing the code from local storage or some where else.
You can find and add ?? Next to the String and then empty string to avoid receiving null.
email = storage.read(Key) ?? “”;
In your case I think it’s your product model and some of its variable is getting null assigned
Best,
CwT Team
@@CodingwithT I wrote as you wrote in your video both in the cloud database and in the flutter code. Apart from me, several people got the same error. There is no specific solution written in them either.My error is that the data is not visible on the Popular products site. No data Found is written, but there is data in the Products collection in the cloud database.
@fizz1028 mila bhai solution
mila solution
@@gautamsolanki3644 bro, i can't understand you, you write in english
I face a problem which is null check operator in vertical card product file
It seems like you're encountering a null check operator issue in the vertical card product file. To address this, you can use the null-aware operator (??) in your model.
For instance, in the model file, where you're accessing the description data, you can use:
description: data['Description'] ?? ' ',
This ensures that if the data['Description'] is null, it'll default to an empty string, preventing null-related errors.
Let me know if you need further clarification or assistance!
sir you fixxed it is error?
hi BrandModel.fromSnapshot function is not shown at the end what to write please help
You should watch the brands backed video in which we created complete model
@@CodingwithT can you mention which video???
Please show a video on how to upload dummy data int upload data screen.. i fail to save data to firebase
I'm about to launch the Admin panel and there you'll be able to store and manage the store data easily
Kindly provide dummy data file. Jazakallah in adavnce
dummy data ki class provide kr dein
How much more videos are there in total?
6 to 7 left then we will start the payment gateways and after that admin panel
product controller error is coming
No data found
I am sorry for your error. It might be an issue with the query or model. Kindly review it again.
facing problem in price range start from 0. smallestprice is 0
Make sure all your products have a price higher than 0.
"Null check operator used on a null value"
products do not load from Firebase and shows an error in brand!
line of code. TProductCardVertical
TBrandTitleWithVerifiedIcon(title: product.brand!.name)
tell me how to fix it. Please
HomeScreen shows "No Data Found!"
GPT chat suggested fixing it to
TBrandTitleWithVerifiedIcon( title: product.brand != null ? product.brand!.name : 'Unknown Brand'),
after starting the application another error appears (ProductController)
suggests replacing with
if (product.productVariations != null) {
for (var variation in product.productVariations!) {
}}
and after these changes an error appears "Invalid argument(s): No host specified in URI file:///"
You have to debug the code and check which variable is getting the null value. If you didn't find the error you can contact me on my whatsapp.
Hi. Do you fix it is error?
mila
@@gautamsolanki3644 you fixxing it is error?