I am starting up as a Flutter user and did some courses on the basic principles. However, I never felt good with all the types of page transitions and State Management solutions. All those guys(and Girls) use so many terms I have never heard of. THIS MUST BE POSSIBLE TO DO IT MUCH EASIER!!!!. That was what I was thinking after every complex explanation! THIS is the most straightforward solution for page transitions and, I did not notice that on the RUclips title, also easy peasy State Management. This is awesome for a simple hobbyist who does not have a degree in programming.
@@tadaspetra I started with Video #1. Now going on for GetX and Firestore and loading examples. Study the docs.... Super videos with main features explained.
Leo en Rien van der Hoek oh okay okay I see now. By the way I know the firestore and GetX livestream was long, and while I would definitely appreciate the watch time. The Friday video will be a recap of it 😊
Wonderful work !! I will replace the multiple package with one , I hope get dive deeper in lazy , routes binding and localization (load locales files From json file & translate with plaure and args) , Thanks for this video
Amazing. Thanks for the video. It clarified a lot about Getx. I believe that like me, many would like to see how Getx would work with lists, forms, and everyday things that need to be reactivated. Thanks again for posting this content on your channel.
Many thanks for the vid, and thanks to Jonny (& others) for some super work. I tried Flutter some time back and tore my hair out over state management. Now that it's this simple, I'll definitely retry Flutter. GetX makes it simple and elegant.
I love the series, the "workers" as reactions in Mobx and the "getter" has computed vars, all without using meta decorations! Bravo! I can imagine using computed vars to validate form fields! Awesome . the debounce is awesome. Just a recommendation to the Dev if he can make a worker like a filter, where the filter will override an observer value with a filtered value. Example: filter(count, (counter)=> counter > 10 ?10 :counter, active: true); filter(text,(text)=> _capitalizeFirst(text));
There are a few things I want to say including some questions: 1) I’m using Provider with ChangeNotifier for an highly complex app. That many Provider classes cause a performance problem. (It is not seen but eventually it happens as shown in debugging tools.) Also using providers is difficult because of syntax and the need of context. The reactive side of the GetX, the Obx, may also cause performance issues since they are basically open streams. So I figured out that the best way for a state management is using the onUpdate side of the GetX. That way updates occur only on demand. The syntax is easy, no context and no calling the controller class inside the main build method of a widget class. 2) When using GetBuilder, what if we need multiple controller classes? In Provider package we have the MultiProvider package. It’s useful to wrap other widgets. GetX does need a wrap too. How can I depend on multiple GetX controllers inside the GetBuilder? (Maybe wrapping them over and over just works but is there a better syntax for readability?) 3) Provider package uses the closest provider class declared in the widget tree. I have post and profile screens in my app. (You can think it like Instagram where you can constantly navigate to a post than its user profile than another post than a tagged person’s profile over and over.) I use some of the provider classes as the logic controller instead of doing logic stuff inside the StatefulWidget. For example there is a ProfileScreenUI class which holds UI related to a user profile. There is also a ProfileScreenProvider class which is consumed by each of the ProfileScreens. A user can navigate to another user’s profile page over and over and do stuff which changes their state. UserA->UserC->UserB-> on it goes on. The screens are totally unique to the corresponding users. So each time the user navigates to a new user (or even the same user’s profile), I create another ProfileScreenUI class using a separate instance of ProfileScreenProvider class as a controller. Because that I give each of the new ProfileScreenUI classes a provider class, they always use the closest one up in the widget tree which is the new ProfileScreenProvider instance. Can I do this with GetX?
1) yea it all depends on the use case. If your project has a lot of streams you should probably rethink it and use onUpdate instead 2) You have access to those controllers inside the other controllers if you need it. You can also just "put" multiple controllers and they should work fine. If the UI depends on multiple of them, then you would probably need to wrap it twice. 3) I don't see why you wouldn't be able to do it, but also I haven't tried something that complex yet
Really liked the video, there is a reason it has 0 dislikes xD Can you do GetX Utils next time like changing Theme and Locale, it has barely any docs about the Utils. That would be great!
7:52 update a instance of a class, 12:16 update a variable, I have to use update method which is option 2 for update user (instance of User class), update a variable works well without using any update function
Awesome, why your videos are always so good, to the point and perfect duration . What do you (Amateur Coder & whom so ever reading my comment) use most also considering writing unit test cases for business logic: -Riverpod -GetX -BLoC (stream controllers) -flutter_bloc -Redux Personally, I have mostly used flutter_block with state/event/yeild sort of architecture with every screen/page. Started getting in to River and GetX but really now with lot of choices getting into confusion...
I think unit tests for all state management solutions should be similar. The concept that you can set the state is the thing that makes unit testing simpler
how to keep app wise state of the application , for example when leaving the second page and going back to second page again it reinitiate the sum controller class with values 0 , what if we to keep the values even if the page is popped?
I'm so glad i found your channel! Is there any way you could make a video-guide, where we could learn how to display complex json-data from an api call using GetX?
thank you so much, clear, concise and very well articulated! question: what's the getx equivalent initstate, superinit and setstate? been trying to get a basic camera screen setup but not sure where cameracontroller gets called, how to set which camera to use and how to dispose. would appreciate some help "translating" / refactoring from standard statedul widget to getxcontroller. most tutorials and examples (like camera package example) use stateful widgets and theres not enough info out there to help me wrap my head around to reverse engineer how getx is working. anything would help, i'm bashing my head on keyboard. perhaps it would be a useful quick video tutorial as well? thanks for your hard work!
The GetX and GetBuilder have an initState in them. But you can also use a Binding if you want to initialize based on the screen you are entering. You can check out the 3rd video in the series to learn about bindings 😊
@@tadaspetra thanks! ya bindings are new to me as well i will see if i can figure it out. is it literally called initstate? and super? or oninit? thx & congrats on hittin that 4k hours and becoming official youtube partner
@@jtpulford2716 Inside the getBuilder and GetX observable they are called initState and there is also a dispose 😊. And thank you! It was a grind to get there haha
Hey I'm starting a new project and am at a crossroads of GetX or Provider/Riverpod. GetX is amazing, but it's new and not a ton of resources or support yet. Seems using GetX is a bit of a gamble since it hasn't "proven" itself quite yet and Provider is tried and true. I see some people say global state is not a good idea and question if GetX can scale. What are your thoughts? Are you going to use it or would you recommend it for a production app? Thanks!
So I would like to preface this with I haven't developed a production app with GetX yet. So I dont know if I'm qualified to answer 😂. From everything I've heard though, there are some bigger companies using GetX, and I haven't really heard any performance complaints about GetX either. The package author has a section about GetX performance. Another point is Riverpod uses global state now too. It's not activated when it's defined but activated when it's used. But it's pretty much just a global variable. So in my opinion, I think you can't really go wrong with any of those options. I would personally go with either GetX or Riverpod because I enjoy them more. But if you're comfortable with Provider it's been tried and tested.
@@tadaspetra Awesome thanks for the info! I have a good feeling about GetX, and the fact that Riverpod is using global state now makes the decision easier. I just wish there were more GetX resources out there. You've done a great job explaining it, thank you for that :)
"The Jury Is Still Out": suppose I am building Book Library Web application, and I am reading book Id 123 on a page number 78. When I click "refresh" button in the browser, "state" gets lost because of application reload. How to maintain the state without hardcoding book Id and page number in the URL? [I think framework needs local and/or remote persistence store for this to work, and any claims "ABC state management implementation uses less memory than XYZ" are too far from real life requirements]
Thanks. Very useful. Looks like I want to move all my stateful widgets to getx. I am trying to find out how to use 'typical streams', like getUserLocation/Calculate distance to somewhere with getx.
Great tutorial friend, I use Get.put() to get Getbuilder to properly work but it keeps the controller's data when I leave the screen, and I want reinitialize it, how do I go about it ?
There are a couple ways, one way i would look into is Bindings. You can bind it to the specific screen and it will get deleted automatically when you leave it. If you want to manually delete is there is a Get.delete 😊
do you have more complex getx example or video and more complex form data with backend service api for end to end knowledge want to learn. Thanks in advanced.
How it can implement change state in UI depending on the for example status of downloading data from Internet ? I mean I want to show progressBar when data is downloading, how I can do it in Getx?
Seems good, maybe I should try to use this instead of bloc for my next project. Just a clarification, what if you have an observable on screen 1, and on screen 2 you have called a method that changes the value of observable in screen 1. Does the screen 1 obs will change the value? Anyways thanks!
Thank you, How to make controller available for all route like BlocProvider in flutter_bloc, Like login controller i want it to be available in all route
@@tadaspetra yes i do initialize it on login screen and after login and Get.offAllNamed() to home screen i get controller not found. you need call put(controller()) before
Hi Tadas. Thanks for your amazing video. You mentioned that you were goning to use GetX for your next project, I am wondering how did you find it so far? I am going to use GetX in my project. your answer would help in my way! Thanks
Hey, this video was from a long time ago. To be honest, I haven't used GetX much since these videos. My main state management package is Riverpod. I just really enjoy the safety and control you get with it
I was looking at applying this to an app I am writing, and I was wondering how you would approach this use case: Using a Navrail, you have created a stack of containers representing pages/views. The user taps and the currentIndex is updated through a simple setState...the page changes. The ever present problem of reaching back to the navrail's currentIndex to change pages from within the page. I uses a ValueChanged to a call back... Which of the many forms of Get would be best?
Just to make sure I understand. So changing something on a page that is not currently displayed from a different page? If so you should be able to use any of the options. But if I’d probably go with GetBuilder since it doesn’t seem like it needs to be reactive. Hopefully I understood that correctly 😅
@@tadaspetra specifically, the navrail has a currentIndex: stackIndex, which when a rail's item's onTap calls: onTap: (val) { setState(() { stackIndex = val; }); },
@@tadaspetra It might be a simpler thing that. I'm just not sure how to make stackindex controlled. What am I wrapping in a GetBuilder with: currentIndex: stackIndex
Oh I think I see what you’re saying. So like how to rebuild the screens based on the stackIndex GetBuilder? So you could have the stackIndex be managed by a controller. And then as far as what gets wrapped in a GetBuilder, to be honest I’m not completely sure of the best approach. You could wrap the whole screen part. But i don’t think that’s very efficient. I’m gonna have to look into that a bit lol
Hello Again, Say I want to create a simple component with only one variable and it ought to be reactive, which shall be more expensive then statefulwidget or get ?
Hello there im someone who has been stuck with RxVMs approach of state management , and i have really liked how getx simplifies Reactive solutions. I have one question though, how do i combine multiple Controllers together so i can create a Centralized State in which i can access anything in it? Thanks
Hey! Thanks so much for these videos. I am trying to apply this with the class model {} and data from mongodb to update users or getting messages or sending messages. Would be great to see these with GetX on here or even on Udemy or other tutorial sites.
Hello, Can I ask can u create a video on how to use Timer in GetX? I have a problem because it's counting but I can't update UI every second no matter what I'm trying thank you.
Cual es la diferencia entre GetBuilder y Obx? Actualmente uso el Obx de esta manera. Obx( (){ if(getController.variable.value){ return SomeWidget(); }else{ return Container(); } )
Nice tutorial !!! I've been worked with it a long time ago ... but it this moment I'm trying to put tabs inside a view with N controllers 1 for each tab. But I've and error when I'm trying to call a method inside my apiRepository. "The method 'logout' was called on null" I took this tab out the tabs view so the method is working fine ... But I need a view with it's tabs. Did you try it ????
How can I access one controller from another? This isthe critical point in any non-trivial App and would be the reason for me to switch to GetX from Provider as it is very painful there...
@@tadaspetra Amazing it works like a charm. Unbelievable easy compared to the ChangeNotifier chaos in Provider. We are close to production and I will now switch to GetX from Provider. Why is this package so underrated? Is everybody just building simple To-Do-Apps and therefore not realizing the flaws in Provider ? Thanks for your tutorial. Sub!!
@@badlifting It's starting to get some traction now :). But yeah I think people just didn't know about it. And even for simple to do apps it might be easier.
Random Gaming I think you can just reassign a new Object to the state everytime. But it isn’t like StateNotifierProvider. I’m not too sure if it would be the same
how to use Getx for bottom navigation bar.. mean i want to change index of bottomnavigation.. i just want to do that i have 4 screen in bottom navigation bar and in first screen i have button ..on press i have go to second index of bottom navigation..
I would think theres a way to store the index in the controller and have the screens wrapped in a GetBuilder or Obx, and then they change based on that state change
GetBuilder and GetX come with an init and a dispose that get executed before the widget is built. Since it’s stateless that would be the same as and initState for statefulwidgets, since it would execute before the widget and thus the page is rendered
Александр Иванов so if you see in the sumController.dart we have an onInit() where we define the workers, we can set the counts in there as well. And they will be set before the widget loads
Hey thank u for the tutorial, I am trying getX on my project, I want to rebuild the whole widget tree of a page so I put empty setstate({ }) while using getx (so its working fine), I want to know is there any way to rebuild widget present natively in getx ?
I’m not sure what you are asking. Whatever you wrap within the Getx will be rebuilt whenever any state changes. So if you have your whole screen wrapped with a GetX then the whole screen will rebuilt whenever state changes
I don’t think it’s really possible before the GetMaterialApp. That’s before the actual app is running. Can you figure out login status before a MaterialApp?
I am starting up as a Flutter user and did some courses on the basic principles. However, I never felt good with all the types of page transitions and State Management solutions. All those guys(and Girls) use so many terms I have never heard of. THIS MUST BE POSSIBLE TO DO IT MUCH EASIER!!!!. That was what I was thinking after every complex explanation! THIS is the most straightforward solution for page transitions and, I did not notice that on the RUclips title, also easy peasy State Management. This is awesome for a simple hobbyist who does not have a degree in programming.
Leo en Rien van der Hoek so this is the 2nd video of the 3 part series. Video #1 is on page transitions if you want to check that out 😊
@@tadaspetra I started with Video #1. Now going on for GetX and Firestore and loading examples. Study the docs.... Super videos with main features explained.
Leo en Rien van der Hoek oh okay okay I see now. By the way I know the firestore and GetX livestream was long, and while I would definitely appreciate the watch time. The Friday video will be a recap of it 😊
I'm mashing the "Like" button but it ain't incrementing enough! Great job as always. Keep it up! Proud of your amazing work.
Haha thanks man! I really appreciate it!
Always smash the button for odd numbers of time :v
maybe because that function is wrapped inside debounce(), try again
Was looking for a good getx tutorial from ages. Thanks for the video. Really good explanation.
Thanks man! Glad it was helpful!
Wonderful work !! I will replace the multiple package with one , I hope get dive deeper in lazy , routes binding and localization (load locales files From json file & translate with plaure and args) , Thanks for this video
Will be going over some of those things in the next video. (Not locale from json tho 😅)
Amazing. Thanks for the video. It clarified a lot about Getx. I believe that like me, many would like to see how Getx would work with lists, forms, and everyday things that need to be reactivated. Thanks again for posting this content on your channel.
I’ll look into that 👍
Many thanks for the vid, and thanks to Jonny (& others) for some super work. I tried Flutter some time back and tore my hair out over state management. Now that it's this simple, I'll definitely retry Flutter. GetX makes it simple and elegant.
Wow i never knew getx so simple... Until now I just kinda ignored it.
Its so fast to get going... Thanks for this definately subscribed
Saabir Mohamed yes exactly! It simplifies so many things
Best introduction to getx
Best tutorial I have ever seen!
59_Yash Raut wow thank you! I really appreciate it 😊
Great job. easy to understand! best GetX tutorial I haven seem!
Thank you 🙌🙌🙌
Really excited about it
Shreyans Sethia hope you enjoyed 😊
@@tadaspetra Absolutely bro!
Great video man 🔥, On to the point. I was frustrated with flutter state management & scoping. This GetX seems seems natural and less cluttered
I love the series, the "workers" as reactions in Mobx and the "getter" has computed vars, all without using meta decorations! Bravo! I can imagine using computed vars to validate form fields! Awesome . the debounce is awesome. Just a recommendation to the Dev if he can make a worker like a filter, where the filter will override an observer value with a filtered value.
Example:
filter(count, (counter)=> counter > 10 ?10 :counter, active: true);
filter(text,(text)=> _capitalizeFirst(text));
Short to Ground I'll let him know and see if this is something on his radar 😊
@@tadaspetra I submitted a feature request just now
Short to Ground good call 👍
There are a few things I want to say including some questions:
1) I’m using Provider with ChangeNotifier for an highly complex app. That many Provider classes cause a performance problem. (It is not seen but eventually it happens as shown in debugging tools.)
Also using providers is difficult because of syntax and the need of context.
The reactive side of the GetX, the Obx, may also cause performance issues since they are basically open streams.
So I figured out that the best way for a state management is using the onUpdate side of the GetX. That way updates occur only on demand. The syntax is easy, no context and no calling the controller class inside the main build method of a widget class.
2) When using GetBuilder, what if we need multiple controller classes? In Provider package we have the MultiProvider package. It’s useful to wrap other widgets. GetX does need a wrap too.
How can I depend on multiple GetX controllers inside the GetBuilder? (Maybe wrapping them over and over just works but is there a better syntax for readability?)
3) Provider package uses the closest provider class declared in the widget tree. I have post and profile screens in my app. (You can think it like Instagram where you can constantly navigate to a post than its user profile than another post than a tagged person’s profile over and over.)
I use some of the provider classes as the logic controller instead of doing logic stuff inside the StatefulWidget.
For example there is a ProfileScreenUI class which holds UI related to a user profile. There is also a ProfileScreenProvider class which is consumed by each of the ProfileScreens.
A user can navigate to another user’s profile page over and over and do stuff which changes their state.
UserA->UserC->UserB-> on it goes on. The screens are totally unique to the corresponding users. So each time the user navigates to a new user (or even the same user’s profile), I create another ProfileScreenUI class using a separate instance of ProfileScreenProvider class as a controller.
Because that I give each of the new ProfileScreenUI classes a provider class, they always use the closest one up in the widget tree which is the new ProfileScreenProvider instance.
Can I do this with GetX?
1) yea it all depends on the use case. If your project has a lot of streams you should probably rethink it and use onUpdate instead
2) You have access to those controllers inside the other controllers if you need it. You can also just "put" multiple controllers and they should work fine. If the UI depends on multiple of them, then you would probably need to wrap it twice.
3) I don't see why you wouldn't be able to do it, but also I haven't tried something that complex yet
Good job.. Its simple and easy to use.. One suggestion is zoom the editor bit more as it would be easy to follow.. Thank you..
shanes2007 yea I should definitely do that. Thanks!
Great video, simple and very clear!
Thank you 😊
Really liked the video, there is a reason it has 0 dislikes xD Can you do GetX Utils next time like changing Theme and Locale, it has barely any docs about the Utils. That would be great!
I’m editing that video today!!! And actually it has 1 dislike yesterday haha but I guess the guy changed his mind
@@tadaspetra link to video
@@Kooshad1 ruclips.net/video/ttQtlX_Q0eU/видео.html
Excellent video. Please use GetX to interact with an api (CRUD) thanks
Yep! That’s definitely in the plans. Might do that after the next video!
Yes that’s the plan. I mostly work with Firebase so I’ll look into that !
7:52 update a instance of a class, 12:16 update a variable, I have to use update method which is option 2 for update user (instance of User class), update a variable works well without using any update function
Great work! Keep it up
thank you! And i will never stop!
Awesome, why your videos are always so good, to the point and perfect duration . What do you (Amateur Coder & whom so ever reading my comment) use most also considering writing unit test cases for business logic:
-Riverpod
-GetX
-BLoC (stream controllers)
-flutter_bloc
-Redux
Personally, I have mostly used flutter_block with state/event/yeild sort of architecture with every screen/page.
Started getting in to River and GetX but really now with lot of choices getting into confusion...
I think unit tests for all state management solutions should be similar. The concept that you can set the state is the thing that makes unit testing simpler
Thanks for your hard work. Really. it's a good video for getx.
Your layout in the video is very good.
It was nicely explained.Great tutorial:)
Thank you so much!
waiting for it !
I’ll see you then 😊
sa77a j3ab xD
tnx! really comprehensive tutorial.
Awesome tutorial mate! Thks
how to keep app wise state of the application , for example when leaving the second page and going back to second page again it reinitiate the sum controller class with values 0 , what if we to keep the values even if the page is popped?
I'm so glad i found your channel!
Is there any way you could make a video-guide, where we could learn how to display complex json-data from an api call using GetX?
I have a series doing that with firebase 😊, building a todo app with getx. There is a playlist made for it
@@tadaspetra I will definitely check it out!!
thank you so much, clear, concise and very well articulated!
question: what's the getx equivalent initstate, superinit and setstate? been trying to get a basic camera screen setup but not sure where cameracontroller gets called, how to set which camera to use and how to dispose.
would appreciate some help "translating" / refactoring from standard statedul widget to getxcontroller. most tutorials and examples (like camera package example) use stateful widgets and theres not enough info out there to help me wrap my head around to reverse engineer how getx is working.
anything would help, i'm bashing my head on keyboard. perhaps it would be a useful quick video tutorial as well?
thanks for your hard work!
The GetX and GetBuilder have an initState in them. But you can also use a Binding if you want to initialize based on the screen you are entering. You can check out the 3rd video in the series to learn about bindings 😊
@@tadaspetra thanks! ya bindings are new to me as well i will see if i can figure it out. is it literally called initstate? and super? or oninit? thx & congrats on hittin that 4k hours and becoming official youtube partner
@@jtpulford2716 Inside the getBuilder and GetX observable they are called initState and there is also a dispose 😊. And thank you! It was a grind to get there haha
Very useful. Thank you
Hey I'm starting a new project and am at a crossroads of GetX or Provider/Riverpod. GetX is amazing, but it's new and not a ton of resources or support yet. Seems using GetX is a bit of a gamble since it hasn't "proven" itself quite yet and Provider is tried and true. I see some people say global state is not a good idea and question if GetX can scale. What are your thoughts? Are you going to use it or would you recommend it for a production app? Thanks!
So I would like to preface this with I haven't developed a production app with GetX yet. So I dont know if I'm qualified to answer 😂. From everything I've heard though, there are some bigger companies using GetX, and I haven't really heard any performance complaints about GetX either. The package author has a section about GetX performance. Another point is Riverpod uses global state now too. It's not activated when it's defined but activated when it's used. But it's pretty much just a global variable. So in my opinion, I think you can't really go wrong with any of those options. I would personally go with either GetX or Riverpod because I enjoy them more. But if you're comfortable with Provider it's been tried and tested.
@@tadaspetra Awesome thanks for the info! I have a good feeling about GetX, and the fact that Riverpod is using global state now makes the decision easier. I just wish there were more GetX resources out there. You've done a great job explaining it, thank you for that :)
You're a blessing. Thanks!
Thank you for watching 😊
"The Jury Is Still Out": suppose I am building Book Library Web application, and I am reading book Id 123 on a page number 78. When I click "refresh" button in the browser, "state" gets lost because of application reload. How to maintain the state without hardcoding book Id and page number in the URL?
[I think framework needs local and/or remote persistence store for this to work, and any claims "ABC state management implementation uses less memory than XYZ" are too far from real life requirements]
Thanks. Very useful. Looks like I want to move all my stateful widgets to getx. I am trying to find out how to use 'typical streams', like getUserLocation/Calculate distance to somewhere with getx.
Great tutorial friend, I use Get.put() to get Getbuilder to properly work but it keeps the controller's data when I leave the screen, and I want reinitialize it, how do I go about it ?
There are a couple ways, one way i would look into is Bindings. You can bind it to the specific screen and it will get deleted automatically when you leave it. If you want to manually delete is there is a Get.delete 😊
@@tadaspetra Ohh yeaah I understand, thanks brother
Oumar Kane no problem. Glad to help!
It's amazing. Amazing !!!
Thank you 😊
hello, do you have an example of how to use this with googlemaps? I need some help
Well done!
Awesome
Yeah!
It's so cool, I love it
ZERO M glad to hear 😊
do you have more complex getx example or video and more complex form data with backend service api for end to end knowledge want to learn. Thanks in advanced.
Phyo Min Zaw yes I do! I made a series for a full Todo app with Firebase. There’s is a playlist of that series 😊
can i use getx, obx, getbuilder in same extended class of GetxController class?
I don’t see why not 😊
How it can implement change state in UI depending on the for example status of downloading data from Internet ? I mean I want to show progressBar when data is downloading, how I can do it in Getx?
Seems good, maybe I should try to use this instead of bloc for my next project.
Just a clarification, what if you have an observable on screen 1, and on screen 2 you have called a method that changes the value of observable in screen 1.
Does the screen 1 obs will change the value?
Anyways thanks!
Yes, any obs observing that state should update 😊
@@tadaspetra thanks for the clarification :)
Thank you,
How to make controller available for all route like BlocProvider in flutter_bloc,
Like login controller i want it to be available in all route
Saged saeed you just have to initialize it and it's globally available wherever you need it 😊
@@tadaspetra
yes i do initialize it on login screen and after login and Get.offAllNamed() to home screen i get
controller not found. you need call put(controller()) before
Hi Saged, use:
Get.put(GlobalController(), permanent: true);
How do you manage with a RX for a model that has required parameters to make it .obs?
Hi Tadas. Thanks for your amazing video. You mentioned that you were goning to use GetX for your next project, I am wondering how did you find it so far? I am going to use GetX in my project. your answer would help in my way! Thanks
Hey, this video was from a long time ago. To be honest, I haven't used GetX much since these videos. My main state management package is Riverpod. I just really enjoy the safety and control you get with it
I was looking at applying this to an app I am writing, and I was wondering how you would approach this use case: Using a Navrail, you have created a stack of containers representing pages/views. The user taps and the currentIndex is updated through a simple setState...the page changes. The ever present problem of reaching back to the navrail's currentIndex to change pages from within the page. I uses a ValueChanged to a call back... Which of the many forms of Get would be best?
Just to make sure I understand. So changing something on a page that is not currently displayed from a different page? If so you should be able to use any of the options. But if I’d probably go with GetBuilder since it doesn’t seem like it needs to be reactive.
Hopefully I understood that correctly 😅
@@tadaspetra specifically, the navrail has a currentIndex: stackIndex, which when a rail's item's onTap calls: onTap: (val) {
setState(() {
stackIndex = val;
});
},
You should be able to find whatever controller you’re looking for with Get.find even within navrail
@@tadaspetra It might be a simpler thing that. I'm just not sure how to make stackindex controlled. What am I wrapping in a GetBuilder with:
currentIndex: stackIndex
Oh I think I see what you’re saying. So like how to rebuild the screens based on the stackIndex GetBuilder? So you could have the stackIndex be managed by a controller. And then as far as what gets wrapped in a GetBuilder, to be honest I’m not completely sure of the best approach. You could wrap the whole screen part. But i don’t think that’s very efficient. I’m gonna have to look into that a bit lol
Hello Again, Say I want to create a simple component with only one variable and it ought to be reactive, which shall be more expensive then statefulwidget or get ?
GetX extends statefulwidget so it will be similar. You can't go wrong with either!
@@tadaspetraCool, Thanks !
Thank you.
Hello there im someone who has been stuck with RxVMs approach of state management , and i have really liked how getx simplifies Reactive solutions. I have one question though, how do i combine multiple Controllers together so i can create a Centralized State in which i can access anything in it? Thanks
Tesfahun Kebede I think you could use bindings for this. And create a binding for the whole app.
@@tadaspetra Thanks Buddy , i will check those out , it'd be great if you upload a video that covers that.
Keep Up the Good Work !!!
Tesfahun Kebede there next video in the series has it 😊. ruclips.net/video/ttQtlX_Q0eU/видео.html
if you click home and re-open app from stack, the app will restart ??
Hey! Thanks so much for these videos. I am trying to apply this with the class model {} and data from mongodb to update users or getting messages or sending messages.
Would be great to see these with GetX on here or even on Udemy or other tutorial sites.
When do I use GetX and when do we use ObX? How can i decide?
If you need anything onInit or dispose then use GetX. But if you just want to listen to the changes then ObX
can you create a video using getX, pagination API?
I'm new to flutter, Will getx hold data even you move into different screens?
awesome sir
Thank you 😊
Is it possible to change appBar title with obx or getx? It's like onClick title change?
Hello, Can I ask can u create a video on how to use Timer in GetX? I have a problem because it's counting but I can't update UI every second no matter what I'm trying thank you.
Thank you
Zaid z thank you for watching!
sounds good
thanks a lot!
123/5000
You think it is possible to put an MVC example with obx or getx for updates from a database values and update the view?
Next week there will be a video with GetX and Firebase. But I’m not sure if it will be very strictly MVC
Cual es la diferencia entre GetBuilder y Obx?
Actualmente uso el Obx de esta manera.
Obx( (){
if(getController.variable.value){
return SomeWidget();
}else{
return Container();
}
)
Obx is for reactive (streams) and GetBuilder is for where you have to call update()
do you have any tutorial using ValueBuilder ?
No I haven’t taken a look at that one
Nice tutorial !!! I've been worked with it a long time ago ... but it this moment I'm trying to put tabs inside a view with N controllers 1 for each tab. But I've and error when I'm trying to call a method inside my apiRepository. "The method 'logout' was called on null" I took this tab out the tabs view so the method is working fine ...
But I need a view with it's tabs. Did you try it ????
I have never tried doing something like this unfortunately. It could be the routing messing stuff up
@@tadaspetra I hope it, unfortunately we must do without getX or generate my custom tabs system.
How can I access one controller from another? This isthe critical point in any non-trivial App and would be the reason for me to switch to GetX from Provider as it is very painful there...
badlifting this is part of what makes GetX special in my opinion. You literally just do Get.find inside the other controller. That’s it.
@@tadaspetra Amazing it works like a charm. Unbelievable easy compared to the ChangeNotifier chaos in Provider. We are close to production and I will now switch to GetX from Provider. Why is this package so underrated? Is everybody just building simple To-Do-Apps and therefore not realizing the flaws in Provider ? Thanks for your tutorial. Sub!!
@@badlifting It's starting to get some traction now :). But yeah I think people just didn't know about it. And even for simple to do apps it might be easier.
uhm, 14:14 how can we increment the value even though it's final ?
or is that because we're using e.g. `count1.value++`
tysssm btw you're amazing
OOOOOOOOOHHHHHH THANKS VERY VERY MUCH.. i was wondering where do i trigger the change
it was just to put controller.update();
MAn one question, can i create immutable classes as states?
Random Gaming I think you can just reassign a new Object to the state everytime. But it isn’t like StateNotifierProvider. I’m not too sure if it would be the same
great great video dude
Random Gaming thank you 🙌
You dont need 'Get.Find().increment();' just use the context '_.increment();'
Shinoda kl I think you're right, but I just wanted to show off the Get.find and it seemed to fit well there
There's a widget called 'Getview' in getx.
If I called update in the controller, will all child widgets of 'GetView' be rebuilt?
I think GetX has changed a bit since this video. The basics are still there, but. I would check the documentation
Can you tell me the cons of GetX?
how to use Getx for bottom navigation bar.. mean i want to change index of bottomnavigation..
i just want to do that i have 4 screen in bottom navigation bar and in first screen i have button ..on press i have go to second index of bottom navigation..
I would think theres a way to store the index in the controller and have the screens wrapped in a GetBuilder or Obx, and then they change based on that state change
Yes i have done this using same logic
what about initState, dispose if use only stateLessWidgets?
GetBuilder and GetX come with an init and a dispose that get executed before the widget is built. Since it’s stateless that would be the same as and initState for statefulwidgets, since it would execute before the widget and thus the page is rendered
@@tadaspetra Please give example how it work. If i need initState _count = 1
Александр Иванов so if you see in the sumController.dart we have an onInit() where we define the workers, we can set the counts in there as well. And they will be set before the widget loads
Hey thank u for the tutorial, I am trying getX on my project, I want to rebuild the whole widget tree of a page so I put empty setstate({ }) while using getx (so its working fine), I want to know is there any way to rebuild widget present natively in getx ?
I’m not sure what you are asking. Whatever you wrap within the Getx will be rebuilt whenever any state changes. So if you have your whole screen wrapped with a GetX then the whole screen will rebuilt whenever state changes
@@tadaspetra Wraping whole widget with Obx() works! thank u so much!
differnce between get.put and get.find
The getter 'count' was called on null. Helpp
Where is MixinBuilder ??
Your voice is cute =)) and thanks for the tuts
Brrrrrrrroo canımı yeeeeee. Sen de az copy paste yapmıyosun ama olsun. Mikrofonunu sevsinler.
太棒了
zoom in the code for your next vid releases. :)
Yea I have been more zoomed in on the recent ones. I apologize
@@tadaspetra no worries!
If I want get user to figure out if he logged or not in or before GetMaterialApp for navigate him to login or home page how ?
I don’t think it’s really possible before the GetMaterialApp. That’s before the actual app is running. Can you figure out login status before a MaterialApp?
Amateur Coder yup by wrapping provider consumer and read instance value I will try wrapping material bu getbuild and try
Yes try it and let me know. But if it worked with consumer then it should with GetX. The GetMaterialApp is just MaterialApp wrapped
@@tadaspetra put this login status checker in your upcoming videos as well....please.
P.S. You're Awesome 😎😎😎
why does getx get a lot of hatred?
ithink iwill stick with getx because i get used to it
Why my code not recognize RaisedButton? :C Pd: im using visual studio code on macbook