Great tutorial for exactly what I was needing to know how to build thanks!
@LeagueRandomPlayer4 жыл бұрын
as always epic work! some of the method and classes here are deprecated but worry not if you use at least android studio it will let you know. i recomend following the docs in FlutterFire along this great video!
@tadaspetra4 жыл бұрын
Yes they unfortunately changed a lot on me haha. But hopefully people still are able to upgrade with the quality docs
@TPITEOTG11 ай бұрын
Thank you for excellent "best practices" guidance! Question: do you use VSC extension to fill "User.fromDocumentSnapshot"? Which extensions do you recommend? Thanks
@TheCryptoFlowerman3 жыл бұрын
Love your videos!! Finally I am at a level to follow along(or maybe just not). Just one question.... when I try your example in flutter null safety I get an error (unexpected null value) and I can’t get me head around it....... instead of Getx in the rootScreen, I am using Obs... it works but for me the logic isn’t clear.... any suggestions? Keep on going with the videos, love them!
@singhaseyha43753 жыл бұрын
that is the great tutorial, but can you share us how to get pagination with getX by using bindstream to append the next list?? please... i'm stuck
@jrheisler4 жыл бұрын
Cool stuff!
@tadaspetra4 жыл бұрын
Thank you! Appreciate it!
@ratrakone37614 жыл бұрын
AuthResult is now UserCredential
@CmdrVimes1773 жыл бұрын
Hey Tadas, great series of tutorials - keep up the good work. I managed to follow thorough the Firebase Auth video ok and was able to update it to take into account the Firebase breaking changes but I have a problem with this video and I cannot see how to solve it. I am getting a Exception caught by widgets library - 'Null check operator used on null value' error in the Root() component. I think its the line that checks the user.uid that is the problem but I cannot see how to solve it. Can you help? Ok, so a further check seems to suggest that it is the entire Root() widget not the user.uid check as I first thought. Still stuck :-(
@GabrielHahn3 жыл бұрын
Same problem with me! Did you manage to solve this error?
@ibrahimmugaibel58113 жыл бұрын
@@GabrielHahn in DataBase>getUser method add "?" to (String? uid) and in the sign in method add '?' to (_authResult.user?.uid)
@boonchaan3 жыл бұрын
Hi Todas I really enjoyed learning with you but I have a quick. maybe not that quici question. this is all very well for nativa apps in witch you log in and the app stays there. but for web the user can refresh. In my case im loosing the user at usercontroller. my idea is to create the database as Singleton passing the user uid to have it handy for saared data across users that is accessed by the user id at an array. but. the question is. can I somehow watch onAuthStatechange and set both the user at userController and the id at the singleton? maybe im a bit confusing. let me know if you have some time. cheers! and thanks for the amazing guidance
@crazymusicnetwork88444 жыл бұрын
Great video how i can update UserController usercontroller = Get.put(UserController()); because i want reload new info of the user. Thanks
@tadaspetra4 жыл бұрын
Create a function inside the UserController to update
@raymondmichael49874 жыл бұрын
I have been pulling my hair here for several minutes; Why I get squiggly line under AuthResult in the authController file; yelling "undefined class"; any thought btw, I tried to avoid "deprecated" errors, will that be the reason? :) That was the new thing I had to change too for comply with the new version of firebase; AuthResult => UserCredential case solved!!
@tadaspetra4 жыл бұрын
Yea firebase and firestore changed a lot of things since this video came out unfortunately. but glad you figured it out!
@lamafattal33152 жыл бұрын
Hello, whenever i hot restart the data is lost from the UI but its stored in firestore. How do i fix this problem?
@21izah2 жыл бұрын
By observable you mean notifying to changes right?
@elgusotube114 жыл бұрын
Cool Example. Do you make a example with GraphQL and GetX?. For example Hasura GraphQL works with suscriptions for real-time data changes, and having an example of these would be great. Thank you in advance for so many contributions.
@tadaspetra4 жыл бұрын
Gustavo Delgado I've never used graphQL at all lol. I should check it out! Thanks!
@sakethparimi76643 жыл бұрын
i am getting The getter 'message' isn't defined for the type 'Object' in catch(e)
@syed.zain.gillani4 жыл бұрын
Hi, I am getting this error on this line email = doc['email']; [] isnt defined for the type DocumentSnapshot
@tadaspetra4 жыл бұрын
Are you sure email field is defined for that document? In firestore
@ReelSkilla4 жыл бұрын
Calling [] directly is deprecated with the latest firestore
@agreensh4 жыл бұрын
Thanks for this, very useful. One thing I'm not sure of - why have you added email to your UserModel (and FireStore)? It's already part of the AuthResult from create or login (with email and password) - authResult.user.email - so no need to store it. Maybe it should still be part of the UserModel for convenience, but no need to store it separately - just initialize it from the AuthResult (save on FireStore data, and read/write counts).
@tadaspetra4 жыл бұрын
Andy Greenshaw you are right it is stored in the Auth, but for my UserModel I usually like to store all the user information into that. So then I can call it once from wherever I need it and have it ready. For example: let’s say you have a profile page, and want to display all the info. Here you just make one function call and you have everything
@agreensh4 жыл бұрын
@@tadaspetra That's why I say it should still be in the UserModel for convenience - but if you add/fetch it to/from FireStore as well, you're increasing your Firebase cost (assuming you have lots of users!).
@tadaspetra4 жыл бұрын
Andy Greenshaw how would you retrieve the email for someone else’s profile page?
@agreensh4 жыл бұрын
@@tadaspetra I wouldn't expose the email (privacy issue), only their name (and identified by the userid). If you do need the email (eg so one user can email another, if you really need to), then do that on the backend (via a cloud function).
@tadaspetra4 жыл бұрын
Andy Greenshaw yea you can do that. But personally I just like to store, I feel like it makes things a lot easier. And Firebase charges per document read. So it is still one document read with the email in there
@jaimepremy4 жыл бұрын
Another excellent video on GetX, and now with Firebase it's really getting exciting. Looking forward to see some videos on working with Firestore streams in GetX. Often times we need to combine and manipulate data from 2 or more documents, before we send this off to the view. I've been doing this with BLOC and RxDart up to now, but I guess it will be much less of a pain with GetX. I did some experimenting like this: final videos = List().obs; VideoController() { _videoService = VideoService(); } @override void onReady() async { videos.bindStream(loadVideos()); super.onInit(); } Stream loadVideos() { return _videoService.getAll(); } The controller is Lazy initialized with binding. The view looks like this: body: GetX(builder: (_) { if (_.videos.length == 0) { return Center(child: Text('Nothing to show yet...')); } return ListView.separated( separatorBuilder: (context, index) => Divider( color: Colors.grey, ), itemCount: _.videos.length, itemBuilder: (context, index) { return VideoTile(_.videos.elementAt(index)); }); }), The data shows up fine but does not update in real time if I modify some field in the db. The only way I found to have it update real time is to initialize the Controller in main.dart, but this creates the stream even before I requested it, so it's not very efficient. Imagine an app with dozens of streams getting initialized at startup. So I definitely need to master GetX a bit more and my hope's are on you for now ;-)
@tadaspetra4 жыл бұрын
Jaime Baum that's definitely an important use case. One note, you're binding the stream onReady, maybe try onInit. I don't know if that would change anything but it's weird that it doesn't get updated 😕
@jaimepremy4 жыл бұрын
@@tadaspetra Thanks, will try.
@jaimepremy4 жыл бұрын
onInit didn't do the trick either. I ended up with this: //VideoController final videos = List().obs; @override void onInit() async { _videoService.getVideos(); } //VideoService void getVideos() async { Firestore.instance .collection("videos") .snapshots() .listen(_setVideos, cancelOnError: true); } void _setVideos(QuerySnapshot qss) { RxList videos = Get.find().videos; videos.clear(); List vdoList = qss.documents.map((e) => Video.fromSnapshot(e)).toList(); vdoList.forEach((element) { videos.add(element); }); } And now it works. I'm sure there's are better ways of doing this, but this might already help others with a similar requirement.
@lbarria113 жыл бұрын
Hi How are yo im getting this error in the root.dart in the uid is with a red mark builder: (_) { if (Get.find().user?.uid != null) { and give me this error The getter 'uid' isn't defined for the type 'String'. Try importing the library that defines 'uid', correcting the name to the name of an existing getter, or defining a getter or field named 'uid'.
@nikalags3 жыл бұрын
same
@lbarria113 жыл бұрын
what i do was delete the ?.uid!
@sakethparimi76643 жыл бұрын
In auth controller the user getter method returns a User not a String. and put _firebaseUser.value instead. Hope this helped!
@emreozbey94173 жыл бұрын
@@sakethparimi7664 hey I fixed this error but now "Null check operator used on a null value" i am getting the error can you help me pls :)
@kribasrimal37783 жыл бұрын
Help! it says Null check operator used on a null value
@Krupupakku3 жыл бұрын
same error here
@super10tamil933 жыл бұрын
String ? Name;
@TheCryptoFlowerman3 жыл бұрын
Same here!
@emreozbey94173 жыл бұрын
same here
@novacoax Жыл бұрын
Same Here. 1 year after
@blacksandedm38944 жыл бұрын
hey i have following error: AuthController not found. You need call put(AuthController()) anyone know when / where to call auth controller? If i call it in the wrapper i get a uid even if no user has been created
@tadaspetra4 жыл бұрын
In the previous video we set up the Auth controller in the initialBinding 😊
@silverCap003 жыл бұрын
It seems mouse and USB-c hub amazon site url are same. Anyway, always thank you for the great lectures!
@tadaspetra3 жыл бұрын
You are right about that lol. Thank you for catching that and pointing it out
@alvincastillo39314 жыл бұрын
Tadas impressive about getx but what about a splashscreen do you have to initialize the usercontroller at the same time that the authcontroller? or u will binding with the page ?
@tadaspetra4 жыл бұрын
Alvin Castillo there's multiple ways to add a splash screen. I think either of your options would work. I'm not sure which way i prefer yet 😅
@victorlongoro45743 жыл бұрын
hi tadas, first thanks for the great tutorial it was awesome, simple to understand and it help me allots but the question here comes. am handling roles in my firebase i.e. admin and customer, am trying to manipulate the root so it provide the routes accordingly but it throw an error for me, try implemented this in provider and it works fine but in getx it really confusing, help me out
@kanegomolema73574 жыл бұрын
can you please do firebase storage tutorial
@tadaspetra4 жыл бұрын
kanego molema already have one 😊 kzbin.info/www/bejne/rpukXqyFg72JsNU
@user-rc2nt1tb2u3 жыл бұрын
When I write this one👇🏻I get an error, any one can help me please? UserModel.fromDocumentSnapshot(DocumentSnapshot doc) { }
@LtWittmann4 жыл бұрын
I don't mean anything, but most of your tutorial is deprecated :( Could you update them? I may wrong tho, so sorry if I am
@tadaspetra4 жыл бұрын
No you are right, it’s because Firebase updated all the setup required. They have a guide for how to update. The overall concept of the video still works, just need to update the initialization
@humansmachines27324 жыл бұрын
hey thanks for the great video but one question after closing the app and reopening it the user from the usercontroller is always null do i need to do some bindings or what else should I do ?
@tadaspetra4 жыл бұрын
The user is stored on Firestore, so you could probably need to retrieve the information again, when you open it. I would do that in a binding, since it first checks auth and then leads you to another screen
@nikalags3 жыл бұрын
In user.dart i can't use the variable id = doc.documentID; And in database.dart there is "Undefined class 'Firestore'." Help
@kishon28103 жыл бұрын
id = doc.id
@Petter0923 жыл бұрын
in database.dart replace Firestore for FirebaseFirestore
@rrbb4 жыл бұрын
Hi , when i restart app, uid is stay but user.name is not load. i mean , when restarting app, root say, i have uid, go home, but home app bar have infinity loading, not name thanks for tutorial.
@lamafattal33152 жыл бұрын
Hello, did u solve the problem?? Whenever i hot restart data is lost form the UI.
@mightycat22194 жыл бұрын
With respect, This channel is great but it really hard to learn from you. I would assume this is not a beginner lessons because you change the code between the video without explanation. I would suggest beginners to learn from Codex channel instead.
@tadaspetra4 жыл бұрын
I appreciate the feedback. I try to cover the most important parts so that the videos don’t end up being too long. But I will take this into consideration