Тёмный

Flutter State Management - Basics of the Provider Package 

Johan Jurrius
Подписаться 10 тыс.
Просмотров 14 тыс.
50% 1

In this video we look at why setState() will not always work to manage state and introduce the Provider package as a State Management Solution.
Watch the whole playlist for my Flutter course here: • Flutter Course .
You can find my Dart playlist here:
• Dart Basics and a bit ...

Опубликовано:

 

1 июн 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 63   
@awesomelygeeky4519
@awesomelygeeky4519 3 года назад
Simplicity at its best... Someone give this guy a 🏅🏅🏅🏅 I've struggled with state management for a while and other RU-vidrs are just downright confusing. Thanks man really. You've just earn yourself a subscribe
@ReimeiNoRaimei
@ReimeiNoRaimei Год назад
Thanks beyond Thank you, You explained a concept I've been having trouble with for a long time. Thank you very much!
@MrVipulLal
@MrVipulLal Год назад
Long but clear video. Thanks
@arunpraseeth9940
@arunpraseeth9940 3 года назад
Have gone through so many provider tutorials for the past 5 days. Haven't come across anything like your tutorial. The best explanation from my point of view. Worth an hour! you have done a great job. Thank you so much ;) Kindly upload many videos in future.
@parallel_53
@parallel_53 2 года назад
The John Rambo reference alone already deserves a thumbs up. Great videos.
@antoniojoseperessousa5045
@antoniojoseperessousa5045 3 года назад
Fantastic explanation! Very simple and easy-to-follow example, perfect and paused diction. Thank you very much, sir!
@bryanbarreto
@bryanbarreto 2 года назад
Dude, sorry for my bad english I'm a iOS developer, and trying to learn flutter :D And your video tech me me a LOT. It's the best video that I saw about provider It's short, simple, well explained and with a lot of examples
@dhruvvarshneydeveloper
@dhruvvarshneydeveloper 2 года назад
some timestamps i have on my notebook: 00:00-5:05 - basics 5:05- 24:00- example using setstate 24:00 - same example using provider 35:00- (listen: false) concept 44:14- context.watch and context.read concept 51:00 - about consumer hope this helps!!
@yahyeabdirashid9716
@yahyeabdirashid9716 Год назад
supper thanks bro
@iamtafara
@iamtafara Год назад
You sir,, are the best teacher under the sun. you could have shown us all this in 8 mins but u took yo time to explain everything in depth with no complicated terms. hat off for you.
@matejmichalek6115
@matejmichalek6115 2 года назад
The best explanation for Provider. Thank you so much.
@xpwahab1
@xpwahab1 3 года назад
This is one of the best explanations for Provider! 🙌
@adrycallencatapang7400
@adrycallencatapang7400 2 года назад
The basics as well as the fundamentals are very important in order to really learn something, and this guy is doing a great job! Keep on uploading simple and amazing tutorial videos like this one!
@dataluchs1288
@dataluchs1288 2 года назад
You're skills to explain are top class! Best explanation I heard so far
@Pedro-il8kx
@Pedro-il8kx 2 года назад
Undoubtedly the best introductory video.
@idkanymoreman
@idkanymoreman 3 года назад
listen.. LISTEN!! i have been struggling with Provider for weeks because i didnt understand how it gets passed and configured.. after watching your video.. i have a blackbelt on Provider.. i can pass anything from screen to screen without hassle.. you have no idea how thankful i am for this video. you sir earned a like and a sub.
@DiyaLalDileepLal
@DiyaLalDileepLal Год назад
very simple explanation. understood provide along with callback which was confusing for me. Thank you....
@akhilkn225
@akhilkn225 2 года назад
easy explanation please make a video on adding to Wishlist
@mrnsbrown
@mrnsbrown 2 года назад
Super helpful, well explained too Dankie!
@julianc528
@julianc528 3 года назад
This tutorial was AMAZING. Thank you so much for explaining with simple code. I just tested an implemention of this on a same app and it works beautifully. Thank you again!
@NuwanThisara
@NuwanThisara 2 года назад
Your tutorials are great. they are well explained, i feel like I'm in the school again. some channels just show some codes but they don't help us to learn. thank you for being different and keep it up.
@iamsunnymac
@iamsunnymac 2 года назад
Hats off. I was a bit confused with the topic but Now I feel satisfied. Subscribed and also shared the video with all my students and friends. Thank you, Man. God Bless you!
@eskindergetachew4949
@eskindergetachew4949 2 года назад
you debunked "curse of knowledge" ...bravo!! this is how you make a tutorial
@gilangrakean9501
@gilangrakean9501 2 года назад
Thank you very much for this video! It really helps me understand basic use of Provider and how state management works. You also took the extra miles to explain us about efficiency in the last part of the video. Cheers!
@dhruvvarshneydeveloper
@dhruvvarshneydeveloper 2 года назад
fantastic explanation!!!!
@jimaustin3608
@jimaustin3608 2 года назад
Verbose, repetitive, ‘excessive’ detail … EXACTLY what I needed to begin to understand Provider. Good for beginners and (IMHO) even better for us intermediate Flutter ‘wanabes’. Ten years teaching experience in a major public university shows me that this good teaching! 👍
@JohanJurrius
@JohanJurrius 2 года назад
Thanks, appreciate your comment.
@synapsetech129
@synapsetech129 2 года назад
what an amazing explanation!!Thumbs up..Thank you very much.
@joaomarcosmatias6622
@joaomarcosmatias6622 Год назад
Excelent explanation, very well!!!
@andrewmukelabai8209
@andrewmukelabai8209 2 года назад
Excellent tutorial! You have a gift man. Cheers!
@mariagromova2119
@mariagromova2119 2 года назад
Thanks for clear explanation !🙂
@siddhantsaraf1218
@siddhantsaraf1218 3 года назад
Again... an excellent explanation....loved it...
@resurrection355
@resurrection355 2 года назад
great explanation!
@kinoshan591
@kinoshan591 3 года назад
Awesome explaining 👍
@dilansisitha4852
@dilansisitha4852 2 года назад
really good video..thanks for the upload
@awisadestiny5459
@awisadestiny5459 Год назад
Well explained ❤
@yuvalw123
@yuvalw123 2 года назад
Great explanation, thx !
@madhan_gannarapu
@madhan_gannarapu 3 года назад
Super explanation 👍
@jeffersonjohn5228
@jeffersonjohn5228 2 года назад
best explanation
@shanglee643
@shanglee643 3 года назад
Keep going buddy!!!
@nikhilkukreja8498
@nikhilkukreja8498 3 года назад
God bless you Johan :)
@amalsunil4722
@amalsunil4722 2 года назад
Beautiful explanation my man, you have explained why to use it and what are the benfits of the same... this is how one must explain with a practical example. Thnx a lot and have a great day! Subscribed ❤ Something I have just tried and observed rn is that instead of using 'Consumer' we could also just extract the widget into a new Statless widget, so basically we're rebuilding only this build method of our new Statless widget which is then reflected in all the places where we create this Stateless widget instance(more like we're changing the scope of the widget to be rebuilt to only the one that's actually listening to the state property change). Example : class Screen4 extends StatelessWidget { const Screen4({Key? key}) : super(key: key); @override Widget build(BuildContext context) { print('Building Screen4'); return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ TextWidget(), //A listener. ElevatedButton( onPressed: () { //context.read is same as Provider.of.. listen is set to 'false'. context.read().changeData("Ronaldo"); }, child: Text("Change data"), ), Screen5(), ], ), ); } } class TextWidget extends StatelessWidget { @override Widget build(BuildContext context) { print("Building textwidget"); return Text(context.watch().name); } } Please let me know if there's any performance issues with this method, thanks!
@JohanJurrius
@JohanJurrius 2 года назад
Hi, sorry, I do not have time to test. Test it out and use print statements like I did in my video. You will pick up unnecessary builds that way. Also look at using Selector instead of Consumer to only watch a certain set of values.
@amalsunil4722
@amalsunil4722 2 года назад
​@@JohanJurrius Yes sir, I did try it and it works the same way as consumer(basically both does the same thing that is they wrap the widget with a builder method so that only the nearest build method is rebuilt). And I have also used selector and it's amazing, just as you said we can listen to a specific value of our provider type. By the way you videos have taught me a lot, not just how it works but how I can test it myself to predict the behaviour as I code, and that's what made the difference for me. Thanks a lot brother! Love from India ♥
@JohanJurrius
@JohanJurrius 2 года назад
Thanks for the reply. Thats how you learn. Appreciate the reply and info.
@danielbui12
@danielbui12 3 года назад
Thanks so much
@coolmind230
@coolmind230 3 года назад
super... Thank you
@rahulrajeev9763
@rahulrajeev9763 2 года назад
Excellent
@zahrayousefi9400
@zahrayousefi9400 2 года назад
thank you so much
@BboyKeny
@BboyKeny Год назад
Coming from a React background you showed exactly what I imagined setState state management would look like with (passing on the callback through props). I went with Provider immediately since it looks fine for my purpose. I am however curious what the difference in terms of use cases is with Bloc. As far as I've gathered is that with Bloc you less locked into Flutter and that it's more reactive(?) so it might scale better?
@naiduj-jd6sh
@naiduj-jd6sh Год назад
Please upload video on block (using plugin)state management
@ComputerScienceAcademy5220
@ComputerScienceAcademy5220 3 года назад
hey! you should do riverpod
@adeolaodusami9311
@adeolaodusami9311 9 месяцев назад
How is the elevatedbutton not part of the widget tree but the text widget is?
@shakhawathossain3718
@shakhawathossain3718 2 года назад
best
@nurdauletryspay6181
@nurdauletryspay6181 2 года назад
Amazing tutorial, could you share your source code please?)
@NuwanThisara
@NuwanThisara 2 года назад
I followed this tutorial and facing a problem. When the app restarted the value resets to default. I tried to use Shared preferences to save the previous state, but failed. Can you please explain how to do that?
@JohanJurrius
@JohanJurrius 2 года назад
Yes, in this example we do not save the state. You can check my SharedPreferences video on how to do that: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-v821-8FO4MU.html
@NuwanThisara
@NuwanThisara 2 года назад
@@JohanJurrius Thank you for the reply. I found it in your channel after commenting. Just finished it. thank you
@albertussindhu3909
@albertussindhu3909 2 года назад
Listen true will make the repository to get data every second from server... Is that true? Why not you try about riverpod dude?
@alju_.
@alju_. 3 года назад
you kind of over explained main.dart in this video and wasted lot of time
@JohanJurrius
@JohanJurrius 3 года назад
Dear sir/madam. Just a reminder that this is for beginners. You indicated earlier you are advanced. Maybe this playlist is then not for you.
@alju_.
@alju_. 3 года назад
@@JohanJurrius :)
@alju_.
@alju_. 3 года назад
@@JohanJurrius having this posted on GitHub for reference will help a lot too :)
Далее
Flutter State Management - Routes and Provider
34:23
Просмотров 10 тыс.
ELA NÃO ESPERAVA POR ISSO 🥶 ATTITUDE #shorts
00:20
Flutter Local Data Persistence - Shared Preferences
47:40
Riverpod or Bloc? Which One is Better?
3:44
Просмотров 40 тыс.
Flutter Navigation - Routes in Flutter
44:53
Просмотров 10 тыс.
Crust of Rust: async/await
2:34:01
Просмотров 187 тыс.
Flutter Engage
3:58:21
Просмотров 1,7 млн
7 Common Flutter Providers Explained
18:57
Просмотров 19 тыс.