Firebase Auth with GetX | Todo App

  Рет қаралды 33,401

Tadas Petra

Tadas Petra

Күн бұрын

Пікірлер: 103
@faisalbahli
@faisalbahli 4 жыл бұрын
This is just awesome !!! please don't stop the GetX series
@tadaspetra
@tadaspetra 4 жыл бұрын
Faisal Al Bahli I don’t know how much else there is to do, but I’ll probably be using it for some projects
@Septix
@Septix 3 жыл бұрын
I usually don't comment but jesus man you are amazing. No BS, filler crap or anything, straight to the point. Also cannot thank you enough for not using a complicated UI so we see what's actually going on.
@tadaspetra
@tadaspetra 3 жыл бұрын
Thank you so much! That is what I aim to do in every video. And for me it also makes it a lot simpler using easy UIs because the logic doesn’t get lost in ther e
@josueorozcoaltamirano7101
@josueorozcoaltamirano7101 3 жыл бұрын
it would be awesome if you could remake this whole tutorial with the updated information... i'm kind of lost
@vishnuprasadh7692
@vishnuprasadh7692 4 жыл бұрын
Awesome video. Loved it. Keep up the great work 🔥
@tadaspetra
@tadaspetra 4 жыл бұрын
Thank you so much
@JonAndroide
@JonAndroide 4 жыл бұрын
I don't get the error "AuthController deleted from memory" is for any new update on getX library or something like that?
@lubshadpattarathil280
@lubshadpattarathil280 4 жыл бұрын
Perfect and clean
@tadaspetra
@tadaspetra 4 жыл бұрын
Thank you 😊
@deepL0
@deepL0 2 жыл бұрын
6:37 - 9:05 what is the reason for doing that( I mean extend by GetWidget ). I have never seen this
@TechnoDB
@TechnoDB 2 жыл бұрын
GetWidget allows you to access controller by simply writing the keyword controller else you have to initialize the controller by sth like Get.put or Get.find manually.
@jrheisler
@jrheisler 4 жыл бұрын
Great, thanks!
@tadaspetra
@tadaspetra 4 жыл бұрын
j heisler thank you. Appreciate it!
@shoiburrahmankhansifat7176
@shoiburrahmankhansifat7176 3 жыл бұрын
Everythings was work fine but yesterday I migrate the Flutter version to the latest one Flutter 2.2 (stable)and dart SDK version to 2.13(stable). After migration, I get an error on the auth_controller file. Rx _user = Rx(); in that line, it says 1 positional argument(s) expected, but 0 found. Any one help me please!😐
@이승현-c2r
@이승현-c2r 3 жыл бұрын
@Kyden What does Rxn do? compare to Rx
@이승현-c2r
@이승현-c2r 3 жыл бұрын
@Kyden Rxn requires null-safety. gotcha
@이승현-c2r
@이승현-c2r 3 жыл бұрын
@Kyden Thanks!
@rodrodrigues1729
@rodrodrigues1729 Жыл бұрын
Hi there, thanks for this nice video. Two questions, why onAuthStateChanged and not .userChanges()? and why lazyPut?
@poisonels8023
@poisonels8023 3 жыл бұрын
Can you update this serie please
@nudgecodes7471
@nudgecodes7471 4 жыл бұрын
Great , did you think before if you want pass an a argument in controller constructor and defined it 'controller' before widget builder not wrap a widget builder with GetX or GetBuilder!
@fedorstepanov3731
@fedorstepanov3731 3 жыл бұрын
I really liked getx, but still have one question about the right architecture for that package. Because it can fit to mvc and mvvm, but there are a few pretty uncomfortable moments when you try to build this type of architecture in your app. Is it a nice practice to connect one controller to e.g 2 viems?
@DreamBigEducation
@DreamBigEducation 3 жыл бұрын
Hii Bro, i run this code but shows error => *1.Too few positional arguments: 1 required, 0 given. Rx _firebaseUser = Rx(); @AuthController. *2. The getter 'documentID' isn't defined for the type 'DocumentSnapshot'. Try importing the library that defines 'documentID', correcting the name to the name of an existing getter, or defining.. @UserModel Please give me a solution Bro..
@__eugene_choi
@__eugene_choi 3 жыл бұрын
same problem :(
@viniciusgregorio1412
@viniciusgregorio1412 3 жыл бұрын
did u figured out the solution for _firebaseUser? I still don't find how to initialize, and I don't know what argument Rx wants.
@DreamBigEducation
@DreamBigEducation 3 жыл бұрын
@@viniciusgregorio1412 i will send error file(image)..? How to connect you sir..
@yasserharzelli7984
@yasserharzelli7984 3 жыл бұрын
@@viniciusgregorio1412 same here , did u figure it out ?
@viniciusgregorio1412
@viniciusgregorio1412 3 жыл бұрын
@@yasserharzelli7984 yes, call me on discord Skyzitcho#2024
@akhilksugathan
@akhilksugathan 3 жыл бұрын
String? get user { return _firebaseUser.value?.email; } User only updates with new user creation not with login, How to solve
@wizzl8513
@wizzl8513 4 жыл бұрын
In the documentation it says "The use case [of GetWidget] is very rare, but very specific" but in this app we are using it for every screen. I feel like this is not intended. Correct me if I'm wrong.
@tadaspetra
@tadaspetra 4 жыл бұрын
So at the time of writing this, GetView and GetWidget were identical. Maybe that has changed, or maybe the recommended options is GetView now
@wizzl8513
@wizzl8513 4 жыл бұрын
@@tadaspetra Got it, thanks for clarifying.
@Juliapak
@Juliapak 2 жыл бұрын
fyi just to update everyone: FirebaseUser is now User. And you must instantiate not just Rx firebaseUser... While using a GetxController on a class, and using Rx to get a FirebaseUser , you'll be shown an error, that you are missing a positional argument! Use this instead: Rxn firebaseUser = Rxn();
@wesleybarnes5376
@wesleybarnes5376 3 жыл бұрын
Why does the app not log out when you are doing logout() from another screen, I understand the Obx as observing the stream, and reacting to it. Is it not supposed to return Login() when I am down the widget tree, in say "profile" screen. I am coming from a provider mindset where a stream in main.dart use to do this.
@RobertoOrtis
@RobertoOrtis 4 жыл бұрын
You should do GetX pattern and authentication with bindings and dependencies injection
@tadaspetra
@tadaspetra 4 жыл бұрын
Roberto Ortis ya I've been meaning to take a look at GetX pattern. But do you have an example of authentication with bindings and DI
@RobertoOrtis
@RobertoOrtis 4 жыл бұрын
@@tadaspetra I am currently working on an example but can't get the authentication controller to run before GetMaterialApp without running into an error where the controller is not found. I followed a tutorial from another KZbinr but he does the authentication through a Splash screen (which I don't like). I can send you the link to the KZbinr videos I just mentioned but it's in spanish. Let me know. I am still working on my own example and will let you know if I get it fixed.
@tadaspetra
@tadaspetra 4 жыл бұрын
Roberto Ortis I probably won't understand it if it's Spanish haha. But yea definetely send me your example if your figure it out 😊
@RobertoOrtis
@RobertoOrtis 4 жыл бұрын
@@tadaspetra I just got it working. I will let you know when I upload it to github.
@TimKariuki
@TimKariuki 4 жыл бұрын
I have an app where I was using Provider in a stateful login widget. Is there a tutorial for that?
@tadaspetra
@tadaspetra 4 жыл бұрын
I don’t have one exactly for that. But I do have a playlist for provider
@congtoannguyen1940
@congtoannguyen1940 3 жыл бұрын
Why do we want our user to be observeable if I doesn't need to appear on the UI and Can you make a verification for the email.
@akhilksugathan
@akhilksugathan 3 жыл бұрын
I still didn't understand how the Get.back() works in signup. As of my understanding if the user authstate changes then the obx code will run and it will re-run the root code. Isn't it enough to update the user to the home screen, even he is logged from the signup screen? Please reply.
@sowmyancs
@sowmyancs 3 жыл бұрын
Can we use GetxService for Auth service instead of creating the root widget to redirect the user ?
@chendaoeun8381
@chendaoeun8381 3 жыл бұрын
Dear sir, when I try to do this I got an error " The getter 'email' was called on null. Receiver: null Tried calling: email " and I still cannot fix it. Any help me please. thanks in advance!
@bilalabudan9645
@bilalabudan9645 3 жыл бұрын
is it solved?
@Hypothermia1337
@Hypothermia1337 4 жыл бұрын
For having an initialBinding in my GetMaterialApp, is it possible to place multiple unique controllers inside one binding? Since my project needs like ~15 controllers, which (almost all) need to be loaded at the start of the application and display fetched data in a dashboard-kind-of-home-page.
@tadaspetra
@tadaspetra 4 жыл бұрын
Yes, should definitely be possible. There is nothing stopping you from initializing 10000 controllers in a binding.....except maybe the processor power 😂
@ssn1057
@ssn1057 4 жыл бұрын
please make a video on making shop purchase receipt and pdf printing
@tadaspetra
@tadaspetra 4 жыл бұрын
That’s a very specific thing. But I’ll see if I can add it in somewhere ☺️. Thanks for the suggestion
@ssn1057
@ssn1057 4 жыл бұрын
I didn't expect that u'd be interested! Thanks!
@yomna_mi
@yomna_mi 3 жыл бұрын
It shows me an error " the method bindStream was called on null ?
@viniciusgregorio1412
@viniciusgregorio1412 3 жыл бұрын
did you figured it out? same here
@yomna_mi
@yomna_mi 3 жыл бұрын
@@viniciusgregorio1412 yeah it had something to do with get version use this version ^3.26.0 it will fix it or take an instance in main function and don't use getx
@viniciusgregorio1412
@viniciusgregorio1412 3 жыл бұрын
@@yomna_mi tyyyyy
@nijojoseph
@nijojoseph 4 жыл бұрын
​ I think i saw your new tutorial on youtube the firebase getx Todo App the new version. But now I think it is missing.......
@tadaspetra
@tadaspetra 4 жыл бұрын
I made one on freecodecamp. But it wasn’t using GetX 😊. I promise I haven’t removed anything haha
@darshshah5051
@darshshah5051 4 жыл бұрын
Would love to see you make a tutorial for an full fledge expense tracking application!!
@tadaspetra
@tadaspetra 4 жыл бұрын
Good Suggestion! I'll put it on my list. The next two things I want to try is a Flutter website, and then a chat app!
@darshshah5051
@darshshah5051 4 жыл бұрын
Wow!!
@shubhammittal9764
@shubhammittal9764 4 жыл бұрын
@@tadaspetra When chat app coming brother? Please use GetX, and more importantly Realtime Database for chat functionality because in real world scenario RTDB is about 5 times cheaper than Firestore for chatting.
@saransundaresanmadhavan810
@saransundaresanmadhavan810 3 жыл бұрын
For Google Sign in , how to hide the login page if a user is already logged in? Can u make a separate video for google sign in too?
@tadaspetra
@tadaspetra 3 жыл бұрын
It should be very similar. Firebase Auth provides the data for what use is authenticated, it doesn't matter whether it's from GoogleSignIn or normal. And in the book club series we added google sign in, so you can take a look there too
@이제영-n5b
@이제영-n5b 3 жыл бұрын
hello sir, it was so wonderful and nice tutorial. btw i wonder authcontroller can detect one user per one device???
@FunGuardian
@FunGuardian 4 жыл бұрын
may i know, why you make obx in root.dart
@tadaspetra
@tadaspetra 4 жыл бұрын
FunGuardian so if the authentication state changes it will move you to a different screen 😊
@FunGuardian
@FunGuardian 4 жыл бұрын
@@tadaspetra wow, thx a lot for replying
@tadaspetra
@tadaspetra 4 жыл бұрын
FunGuardian no problem! 😊
@yulkin2002
@yulkin2002 4 жыл бұрын
hi Tadas, how would you test this code? I'm really at a loss when it comes to testing GetX controllers
@tadaspetra
@tadaspetra 4 жыл бұрын
It is similar to testing any other state management. You can just load the state in manually, and then run the test relying on that state
@yulkin2002
@yulkin2002 4 жыл бұрын
@@tadaspetra I tried that, but getting a missing plugin exception with respect to Firebase Auth, I assume because it's called from inside the controller. I know we must set up Firebase before testing any code that depends on it, haven't yet found any info on how to set up Firebase auth
@tadaspetra
@tadaspetra 4 жыл бұрын
@@yulkin2002 ah yes. Testing shows a lot of architecture problems. I guess the architecture I was showing was not too good haha. Firebase dependencies should be passed into the controller to help with encapsulation. Then you can mock Firebase Auth 😊
@yulkin2002
@yulkin2002 4 жыл бұрын
@@tadaspetra ah I see, let me give this a try. thanks :)
@yulkin2002
@yulkin2002 4 жыл бұрын
@@tadaspetra on a second thought, since we use stateless widgets, do we really want to initialize Firebase auth in the screen widget code? I would think not, since it will only be used inside the controller. If not inside the widget, what's the appropriate place to initialize auth and pass it into the controller? EDIT: I think the way to go would be bindings? Found this nice example: github.com/jonataslaw/getx/issues/757
@akhilksugathan
@akhilksugathan 3 жыл бұрын
For those having problem with e.message , Problem solved by adding "on FirebaseAuthException" before "catch" and converting "e.message" to "e.message.tostring()" Full Code: void createUser(String email, String password) async { try { await _auth .createUserWithEmailAndPassword(email: email, password: password) .then((value) => Get.offAll(Home())); } on FirebaseAuthException catch (e) { Get.snackbar("Error while creating account", e.message.toString(), snackPosition: SnackPosition.BOTTOM); } }
@АлександрИванов-ю8с8г
@АлександрИванов-ю8с8г 4 жыл бұрын
please make video about binding.
@tadaspetra
@tadaspetra 4 жыл бұрын
Александр Иванов I don't know if there's much more to it then what I covered in "GetX Other Features" video. Is there something else you would like to know about it
@markkevingatchalian4348
@markkevingatchalian4348 3 жыл бұрын
Hi! Tadas, How can i make this a role base login with 3 types of user [admin,collector,user]? im stuck with this .. Thank you!
@tadaspetra
@tadaspetra 3 жыл бұрын
The authentication service I don’t think you can do that, BUT you usually store more user information in firestore. So you can store what type of user they are and during the login process check that as well, and send them wherever necessary based on that
@markkevingatchalian4348
@markkevingatchalian4348 3 жыл бұрын
@@tadaspetra I already added role info in firestore but I dont know where to check the role during login I'm just a beginner .. return GetX( initState: (_) async { Get.put(UserController()); }, builder: (_) { if (Get.find().user?.uid != null) { return AdminView(); } else { return LoginView(); } } ); }
@tadaspetra
@tadaspetra 3 жыл бұрын
@@markkevingatchalian4348 Whenever you are calling the authentication, you can check it right after you get authenticated
@thestacksdev
@thestacksdev 3 жыл бұрын
It's so seamless
@elliotjack6999
@elliotjack6999 4 жыл бұрын
I think the discord link might not be working, invite expired for me anyway, looking forwards to the live streams bit late for me so will need to tune in next morning
@tadaspetra
@tadaspetra 4 жыл бұрын
you are right! Its updated now in the descripition to discord.gg/CPwSezC I didn't know they expired lol
@elliotjack6999
@elliotjack6999 4 жыл бұрын
@@tadaspetra cheers joined 😁
@aritrachoudhury8409
@aritrachoudhury8409 4 жыл бұрын
Hi! Can anyone tell me how to use the initState in GetBuilder? class BestDeals extends StatelessWidget { @override Widget build(BuildContext context) { bool isCalled = false; return GetBuilder( init: ProductController(), builder: (_) { if(!isCalled){ _.getBestDeals(); isCalled = true; } return AppBackground( child: _.bestDeals.isNotEmpty ? StaggeredGridView.countBuilder( crossAxisCount: ScreenSize.getWidth(context: context) < 360 ? 1 : 2, crossAxisSpacing: 5.0, mainAxisSpacing: 5.0, itemCount: _.bestDeals.length, padding: EdgeInsets.all(5), shrinkWrap: true, itemBuilder: (BuildContext context, int index) { return ProductCard( productDetails: _.bestDeals[index] ['product_details'], productQuantities: _.bestDeals[index] ['product_quantity'], ); }, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), ) : SpinKitFadingCircle( color: Colors.white, size: 50.0, ), ); } ); } } How to implement this code in a better way?
@mitzukodavis7393
@mitzukodavis7393 4 жыл бұрын
first
@evansaddo2965
@evansaddo2965 4 жыл бұрын
You are doing great but you need to improve your video quality
@tadaspetra
@tadaspetra 4 жыл бұрын
Evans Addo how so?
Firestore User with GetX | Todo App
9:20
Tadas Petra
Рет қаралды 15 М.
Firestore Stream with GetX | Todo App
13:24
Tadas Petra
Рет қаралды 18 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Get CLI: A GetX Tool
10:44
Tadas Petra
Рет қаралды 18 М.
How to Find Good App Ideas
14:08
Aivars Meijers
Рет қаралды 10 М.
Auto Form Validation in Flutter with GetX || Flutter || GetX
15:13
Ripples Code
Рет қаралды 29 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 325 М.
Modern Python logging
21:32
mCoding
Рет қаралды 209 М.
Firebase x Flutter Tutorial - Firebase Authentication🔥
8:08
Flutter Guys
Рет қаралды 19 М.