Amazing explanation, to the point, but importantly covering almost all of the necessary basics. Articulating well in this manner is an awesome skill and somewhat rare as well. Appreciate the hard work and the effort man.
I watched this video when I had no knowledge on state management , I understood nothing , then I read Flutter Complete Reference Book and watched this video again , now it completely makes sense. GoodJob
I have been struggling to implement provider in my project for a long time , but I made it work right after this video. Thanks for saving me from countless hours of head smashing
awesome explanation, and what makes you special that you are precise and concise. let me add that it would be better if you can share a specimen of source code ( i believe this way would increase the number of viewers also )
Cara muito obrigado pelo vídeo. Embora eu não tenha feito como vc, vc me deu uma luz pra resolver meu problema. Eu estava usando o ChangeNotifierProvider e não estava funfando nem pro decreto. É pq eu tinha usando um MultiProvider e tinha dado um vacilo lá trás. vlw ai jovem
May I know if I obtain a change notifier, and would like to listen to its change in the same widget. So I should wrap a ChangeNotifierProvider and Consumer in the same widget, or is there any other cleaner way?
Yes. But it’s always a good idea to make your widgets as small as possible. If you only need the changenotifier for that ONE widget then it may bet better to just use a StatefullWidget. I’ve been using Riverpod the last year, so haven’t thought about regular Provider since I made these vids
@@FunwithFlutter Thank you for your reply. I think it is a bit clumsy to set up a provider and consume it immediately. I have tried to create a stateful widget called ChangeNotifierBuilder and it works. It takes a change notifier and builder function as arguments, which listen to the update of the ChangeNotifier and call setState to rebuild the widget. I think it is cleaner.
if i want to sent data to MyCounterWidget to MyNameWidget it mean from one route to another route so how can i do that kindly guide me about this issue thanks advance
I haven't used Stacked, I've just seen some of the FilledStacks videos. So take whatever I say with a grain of salt. But Stacked is basically just a structured way to use provider with ChangeNotifier, it gives the building blocks and you get a lot out of the box. The only reason I'm not using it is because I like to solve my own problems and learn from those problems and have more control over what I do. Which is essentially what Stacked aimes to solve, it addresses the things you'd want from a state management framework when using provider. Because provider on its own is not a state management solution, its just a way to expose state (how you manage the state is up to you). So if you want a structured way to manage your state, then Stacked seems like great solution. But it is very opinionated on exactly how things should be done. If you want more control over what you're doing then going from scratch is the way to go. You can always look at the source for Stacked and take the things you like. I recently released a video on StateNotifier and provider (which solves a lot of the problems of using provider with ChangeNotifier). I suggest you take a look at that. I've been working a lot with different Provider solutions and I really like StateNotifier (together with sealed classes, or Freezed). I'll also be making a longer series soon showing how I use provider in a full app.
@@FunwithFlutter thank you very much for the detailed answer! It really helps to evaluate the value of such solutions. Keep up the good work. Do you offer consulting or freelance work as well as teaching?
@@1879heikkisorsa No problem, I love talking about this. And yes, I do freelancing. You can reach me at funwithflutter@gmail.com if you have any enquiries.
The return can return the child, and show that. But then that child would be cached, and you get a performance benefit because Flutter won't rebuild the child.