Flutter Provider Package In Depth - Change Notifier Provider
Vložit
- čas přidán 27. 07. 2024
- The provider package offers incredibly flexible and powerful state management solutions for Flutter. In this series we take a look at the different kind of providers available in the provider package as well as different ways to import them into our widgets.
The first part of the series covers Change Notifier Provider which provides a great way to link your widgets to a backend state class as well as non-reactive data solutions such as Shared Preferences, SQLLite, and REST APIs.
Github: github.com/nhandrew/WaxApplic...
Socal Media:
Twitter: @andyjulow
Patreon:
/ andyjulow - Věda a technologie
'I finally got that whole thing memorized' 😂. Now that's the kind of honesty we need from programmers
Really got goosebumps when I really realize that now I'm understanding the provider like a pro! Thank you so much 😍
Дружище, огромное спасибо за твой труд! Это самое лучшее описание Change Notifier Provider из тех, что я нашёл. Точнее, единственное, изложенное простым и понятным человеческим языком. Спасибо огромное!
Really needed this video! This made the whole state management flow with provider finally click, which is making the development process A LOT easier, thank you for the work you put into this!
great video keep them coming! 1-2 high quality videos like these per months would be really appreciated :)
One thing i really like about your tutorials is that you take real time examples, which is hard to find in genereal, Thanks a ton Andy ! Keep going, Keep sharing :)
good tutorial i haven't seen a flutter tutorial as clear and good as urs it really help me
This was so helpful. Thank you Andy for taking the time to make a complete example. (And I just want to preemptively congratulate you on reaching 1 million subscribers and getting a job as Google's Head of Flutter Tutorials.)
I've been learning Flutter for a little while now, but I've always been confused by Provider and state management in general. This is the first resource I've found that makes it really easy to understand. You've got a new sub. Thank you!
This is a great channel with contents that are helpful in real life and it discusses in depth. So please don't stop and keep going. I wish you all the best!
Great and clear concept of provider state management
Super clear explanation.
I have gone through several provider tutorials, but this one is outstanding!
Subscribed!
Thank you.
A timely and Informative upload as compared to other complex tidbits present. Keep it coming Andy :)
This tutorial is really helpfull for me , now, I understand the provider. May I wait from you other kinds of providers like proxy provider, stream provider, future provider. thank you very much.
This tutorial is excellent, thank you for such a helpful and inciteful lesson.
For me, this is the best provider tutorial for beginner. Thanks man 👍
Very helpful. After a long search, an easy way to understand the concept. Good job !
this video helped me understand providers, thank you!!
Thank you. I'm trying to get my head around Provider, and this is very helpful. Andrea Bissoto's (sp?) course is also extremely good, but it moves REALLY FAST, so this course nicely fills in the holes. Between the two, I'm thinking that I am finally starting to get it.
Thank you Andy, this is the best tutorial of Provider for me
Just the right knowledge I need for my project. Thanks again for your nice tutorials.
This is one great example and fits perfectly into real world usage! Keep it up!
I appreciate your style of explaining things bro. Subscribed.
Very good tutorial - Provider based on Inherited Widgets , a very big concept to understand. Thank you !
Would love to see Provider With Consumers And Firebase as API please... not authentification though - just writing and getting data Please, thank you !
Awesome!!! It is very helpful, thank you!
Finally I get it, thank you, thank you, thank you.
Perfect tutorial for absolute beginners.
I want to thank you for the indepth video's you are providing (pun intended xD).. Also a novice here and finally starting to understand how everything works.
That's great, I am glad to know these are helpful.
@@andyjulow4388 great and very helpful video .
Please say about yourself
This is great thank you!
Thank you very much for your work!
Amazing video, Thank you so much
Great video, thanks a lot!
Thank You Very Much Sir. This is great
Great! Thank you!
Andy sir is the best 🔥🔥. I like watching your videos
Quite helpful! Thanks
hi Andy, Nice tutirual! Between, Explain about the listeners (Consumers)
thanks. this is awesome
Thank you so much :)
Thank you sir.
thank you !
Hi! Thank you so much for this lesson! I'm still new to Flutter and I can't figure out how to save Boolean variables in the same example? Thank you in advance for the answer.
thanks for this tutorial i got it, i think this is very hard for some people coming from Java like me where the react world is something strange.
I hear you. I am from a c#/Java background and I still drilling the idea of observables into my mind
Great video! Thank you for this tutorial. Is there any plan to upload another new video about provider like multiprovider, proxy provider(can access the each provider data) and boilerplate of whole provider for understand?? And this is question : Is state provider different?
Keep going 🥰
would be great to see you do something in depth with Sqflite and state management, there is very little of it about, there is some good stuff with firebase, but nothing really with sqflite
I liked and i subscribed. ✔
Thank you so much for this tutorial. Please can you make the font size bigger
How would you go about testing these providers?
Hey thanks for this video! Much appreciated. Have you used the Provider package with ChangeNotifier in conjunction with SQLite (sqflite package)? I'm having a bit of a hard time getting it to work together.
I haven't yet. Just firestore.
Super awesome tutorial... Please make the fontsize bigger so that we can see the codes much clearly it's my humble request.. I am learning a lot from u.. 😍
Thanks very much. I learned my lesson later and newer videos have a bigger font size. Glad you were able to still make it out.
@@andyjulow4388 I was thinking the same thing while watching, so I'm glad you acknowledged this. Thanks for the great tutorial.
Can you do a video on Riverpod, if enough interest.
That's what I'm looking for.
Thanks Andy!
I'm just a beginner.
I tried to make a form (my UI has same style with your tutor above), but I don't know, how to operate it with Firestore. Tried many times, but i got red errors.
Mixing Provider with Firestore, I'm confused.
Hi Ali, Thank you. I feel your pain on Firestore. It's not as easy as you would think given that both Flutter and Firestore are Google products. Tune into the next video and I'll be working Firestore into the app and using the StreamProvider to connect it to the UI.
@@andyjulow4388
Thank you, Andy. Glad to wait and watch your next video.
@@andyjulow4388 thank you for your effort! Could you please insert into your next videos the combination of getting the FirebaseUser and the user's profile from Firestore? For example a user gets additional infos like phone or favorite color etc directly after he was logged in. I wanna use this "globally" stored info in a drawer and if the user changes his profile info, the data gets updated in the drawer. I think the StreamBuilder is responsible for dynamic changes. I figured out that the Firestore sends requests everytime I open the drawer. That's obviously not want I want. Is it possible to redraw the profile info only if the user changes it manually?
Best regards!
That might need to be the video after next, but yes, that's a good idea. That Auth/profile grab can be awkward to code.
@@andyjulow4388 waiting for steam provider video also add how to listen to continuous data
great explanation. only thing is I wish the fonts were bigger.
Thanks, yes it took me a few videos to figure out the font thing.
Thank you for that great tutorial! Thats very helpful. Is it always a SINGLE instance of a class which you want to provide? Can you not control the state of e.g. multiple instances of that settings class and control the state of each separately? I am really struggling to wrap my head around this...
Thanks Chris. If I understand correctly you could wrap each widget you want to create a unique instance for with its own Change Notifier of type Settings provider. That would create an instance of the class unique to that widget similar to the typescript file in Angular, a bean in Java or the backing class in. Net forms.
Hey Andy. Thank you for your answer. Let's assume we have a class 'car' and a property 'color'. I want to control the state of each instance of car e.g. car1 & car2 separately from anywhere in the app. Let's say we change the color of car1 to blue in one widget. Will this color be present in an other widget somewhere else in the tree?
Andy, thanks for this great Tutorial. One quick question. Why don't we use "set" keyword for the provider model class setters just like we used "get" for the getters? Can't wait for the next subject.
Just an oversight on my part. I've been working with streams too much lately and fell into the habit of leaving it off.
Uhh, doesnt this mean that the values of units and list are always the default values you set in the constructor when you start your app? Loadpreferences is async so it might not get done in time when the widgets load. Also why notifylisteners before you store it in preferences?
Not able to view in 1080P, only 480P :(
1:18when you say refresh is it setstate
you deserve more subs, could u please make the fonts a bit larger? it'll be great for mobile users
I'm getting there. I bumped up the font size in my most recent videos. Thanks for that feedback.
Proceed to the information that the Provider should not be used in medium and large projects as a state manager because of the limitation of ChangeNotifier in relation to the number of listiners that it can answer?
Sorry for bad writing, I don't speak English
I don't know if this is current thinking. Google has embraced Provider pretty wholeheartedly, and it seems that you can't really go wrong learning it well. It's obviously not the ONLY solution, and there will be times when another method works better for the use case, but it seems this is where the Flutter team is going most often.
Is provider sufficient for state management?
I am working on a sizable app using provider only. It's working better than I would have thought, but my preference is rxdart organized in blocs and served with provider
what is the loadPreferences();
Andy saved the user's settings from the 'settings page' to a SharedPreferences object, locally. When the app loads, loadPreferences() retrieves the previously saved settings so the state is as the user left it.
Whoever getting this exception: There should be exactly one item with [DropdownButton]'s value:
you should set your dropdownbutton list first item the same as the value of your getter for units.
If your list is ['imperial', 'metric'] then your getter should be set to 'imperial', and vice versa.
i want 5x playback speed.....
Just a suggestion, please increase font size in your upcoming videos. really have to put too much strain on my eyes to see the code 🙏
I hear you Dinesh. I did in later videos but was still figuring it all out when I recorded this one.
Next time please increase font size
wtf is with the intro man