I'll be doing more Flutter videos on state in the future, including Bloc. Are there any issues you had with this video? I'm always looking for ways to improve so leave a comment with any criticisms.
@aytunch4 жыл бұрын
I am waiting for the BLOC tutorials impatiently:D They are at version 2 already and it is very stable. I think it is time to do a tutorial on it since it's api has changed dramatically and all the bloc videos out there are nearly obsolete. (I am talking about Felix's flutter_bloc package)
@TheFlutterFactory4 жыл бұрын
kzbin.info/www/bejne/rHLCk3WubpeCfpI
@innovationsapps56014 жыл бұрын
It would be great to see a video about GetX, everyone just talks about it now
@tusharchander89355 жыл бұрын
The best video on provider for sure! Thanks!
@TheFlutterFactory5 жыл бұрын
Thanks :) I'm excited to do more flutter videos in the future
@tarkkoprulu77514 жыл бұрын
Thank you for your up-to-date provider explanation! This was very helpful and easy to understand.
@TheFlutterFactory4 жыл бұрын
Thanks 🙂
@TirthPatel4 жыл бұрын
I've recently started using provider package. This video is very helpful for me. Thanks a lot ❤️
@SunFoxx_4 жыл бұрын
Thank you a lot, the clearest explanaition, and you are also covered handling of multiple providers. Very helpful
@purushottampk45304 жыл бұрын
This video is good. Helped me a lot. Love from india
@rahulrvp3 жыл бұрын
This is super helpful. Thanks for the effort!
@AamirKhan-zy5yt4 жыл бұрын
Best explanation. Finally understood the package, Thank You! ❤️
@chrisogonas4 жыл бұрын
That was concise, clear and very helpful. Thanks
@gpiccin4 жыл бұрын
Really good and simple explanation.
@senayb34 жыл бұрын
wow thanks man this really is starting to make sense
@shafiulazam30453 жыл бұрын
thanks, bro. awesome.
@monkeygames44674 жыл бұрын
Thanks this video is so helpful, keep throwing info
@blockchainacademy.community4 жыл бұрын
If you've read the Provider docs and provider counter-example from flutter on Github and you still in some doubt. I highly recommend this video (Y)
@GK-pu6yp4 жыл бұрын
Great examples... "but wait people, there is more!"
@webghost20094 жыл бұрын
great, keep doing the best stuff.
@cvgaviao4 жыл бұрын
Hi, thank for the video. One question. do we really need a StatefulWidget around the form? wouldn't a Stateless + ChangeNotifierProvider be enough to track the state of a form ?
@TheFlutterFactory4 жыл бұрын
The _currentName and _currentColor are only used in this Widget. Therefore, a Stateful Widget is needed. Don't store state outside of a widget if it isn't used in more than one place. You can always refactor later if you need to access those values in more places.
@dartcode23094 жыл бұрын
7:17 setState() is unnecessary. ChangeNotifierProvider will listen for changes in the model object and it will rebuild widget.
@azharuddinkhan18654 жыл бұрын
Right I wanted to say same thing.
@maheshjamdade14 жыл бұрын
agree and if we don't remove setState using provider doesnt make any sense
@TheFlutterFactory3 жыл бұрын
Good catch. It was part of the original code and I forgot to remove it. It just causes and additional rebuild. I'm currently working on an update to this video for version 4
@abdallahhussein59972 жыл бұрын
I wish this video can be part two, part 1 could be UI I would like to follow up from scratch
@ibnukhaldun86254 жыл бұрын
thanks this video really help me so much as beginner, compared to bloc, which is better? can we use both in same project?
@TheFlutterFactory4 жыл бұрын
Neither is better. It depends on your use case? Provider is a dependency injection library that can be used for state management. Bloc is a state management library. Bloc is better suited towards bigger, enterprise level apps.
@LUKAS36755 жыл бұрын
wow how did I missed the selector feature, thank m8!
@TheFlutterFactory5 жыл бұрын
I know. It's great, right? It was only introduced a few weeks ago so most devs haven't tried it out yet. I'll be doing more videos on state management solutions in the future.
@ilkinhamid10724 жыл бұрын
Thank You
@belqisshida53455 жыл бұрын
Widget A. Widget B. Widget C. Here when I update a state in Widget A with provider, the Widgets B and C rebuilds too. So how to avoid unnecessary rebuilds in B and C ?
@TheFlutterFactory5 жыл бұрын
That's what consumer and Selector are for. Don't forget the listen flag that I mentioned in the video. That is VERY important if you want access to your provider without listening for changes.
@AlanTuringWannabe5 жыл бұрын
I enjoyed your video. Please do a follow up using the FutureBuilder. I'm trying to load in a json file to be used later on in the tree but it isn't rebuilding the children after the future completes. Thank you.
@TheFlutterFactory5 жыл бұрын
I'll be doing videos on futures and streams in the near future
@AlanTuringWannabe5 жыл бұрын
@@TheFlutterFactory I actually got past my issue. I'll be writing up a Medium entry and posting my code on Github eventually. I'll share my solution when I do.
@jd310684 жыл бұрын
Thanks for this, I just finished Max's course on Udemy (which is very good) the Selector though isn't part of it yet
@TheFlutterFactory4 жыл бұрын
Yeah he's great. Selector is very new so I'm not surprised
@GuilhermeCarvalhoCarneiro4 жыл бұрын
Hello, first of all congratulations on the content, very interesting. I have a question about the use of the Provider, I am Brazilian and here we have a very active community where in most of the videos it is said that the Provider should not be used in medium and large projects because of the limitation of ChangeNotifier, this information comes ? I wonder why Google would recommend this state manager if it has performance limitations. I apologize for the mistakes, as I do not speak English.
@TheFlutterFactory4 жыл бұрын
Because it's a very powerful and useful tool to have in your toolbox. No single tool is useful for all situations 🙂. Bloc is just another good tool. Useful for bigger apps, but overkill for small apps. Many people use both in the same app. Having more than one option is always a good thing
@GuilhermeCarvalhoCarneiro4 жыл бұрын
@@TheFlutterFactory I understand, but would it be a mistake to use Provider on large projects, because of its performance or does it actually make no sense?
@TheFlutterFactory4 жыл бұрын
Provider is ultimately just a dependency injection solution that can also be used for injecting state. Knowing when it makes sense to use either (or a combination of the two) will come with experience. It's all situational
@luckie65934 жыл бұрын
Is provider + stateless widget a good alternative to using stateful widgets ? Any suggestions ?
@TheFlutterFactory4 жыл бұрын
Depends on your situation. There is no one size fits all when comes to software development. If you know for sure you will only have state relevant to one widget (a form might be an example) , maybe you'll just want to put your state locally into a stateful widget.
@luckie65934 жыл бұрын
@@TheFlutterFactory I was thinking the same. Whenever I need a widget with state that is not shared , I will use stateful Widget. Widgets with shared states or data can be stateless with provider
@Inf0rmatix4 жыл бұрын
Very good video, thank you so much! Maybe you could cover how you would use Provider with Firebase Collections and Documents? :) Currently working on an app and thinking about the best way to implement some reactive changes to and from firebase. Open to collaboration if you want to, too.
@TheFlutterFactory4 жыл бұрын
I just uploaded a video showing how to retrieve data in Flutter. I'm using a ChangeNotifier to store the data from Firestore. There are other ways to do this such as using StreamBuilders, but I will cover real time changes in future videos. kzbin.info/www/bejne/bWSTlol6qrNosMU
@gaddesathish4 жыл бұрын
What is the best practice to define ChangeNotifierProvider its app level OR page level?
@TheFlutterFactory4 жыл бұрын
What do you mean by 'page level'? The point of using Provider in this video is to provide a reliable source of state across multiple widgets in your app.
@gaddesathish4 жыл бұрын
@@TheFlutterFactory Page level means => Single Screen level. I am a little bit confused we need to define providers in screen level or need to define all providers in an app level using MultiProvider and access them in the screen/widget.
@TheFlutterFactory4 жыл бұрын
@@gaddesathish Define the providers at the root of your app so they're available to any widgets that need access to them. The official docs provide some great visualizations of the tree structure involved flutter.dev/docs/development/data-and-backend/state-mgmt/simple
@gaddesathish4 жыл бұрын
@@TheFlutterFactory Thank you. I got this sentence "You don’t want to place ChangeNotifierProvider higher than necessary (because you don’t want to pollute the scope). But in our case, the only widget that is on top of both MyCart and MyCatalog is MyApp."
@HP-th3nm3 жыл бұрын
@@gaddesathish Have you found the answer ? If we define providers in screen level, how we define it? Wrap the 'build' method or wrap when we init that screen ?
@georgioss15344 жыл бұрын
Is this an alternative to Bloc? If so why should I use one over the other?
@TheFlutterFactory4 жыл бұрын
Yes. It's a different state management solution. There's also redux, mobx, etc. You should definitely try both. Bloc is purely state management and scales really well. Provider is a lightweight dependency injection solution that also handles state pretty well. It's great for small and medium sized apps. I generally prefer Provider, but you can actually use both in the same app. There's plenty of articles online that do more deep comparisons