Provider and ChangeNotifier in 7 Minutes

  Рет қаралды 55,898

Fun with Flutter

Fun with Flutter

Күн бұрын

Learn how to use Provider with ChangeNotifier in Flutter. As well as all of the different ways to read a value using Provider - read, watch, select, consumer and selector.
00:00 - InheritedWidget
01:11 - Provider
02:09 - Read extension method
02:58 - Watch extension method
03:13 - ChangeNotifier
04:22 - Select extension method
04:52 - Consumer Widget
05:58 - Selector Widget
06:19 - Other tips
Part 2 | Proxy, Stream and Future :
• Provider: Proxy, Strea...

Пікірлер: 77
@michaelmboya5085
@michaelmboya5085 4 жыл бұрын
This channel is a blessing to those of us learning flutter. Keep up the good work
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Thanks Michael!
@sakibshaikh3447
@sakibshaikh3447 Жыл бұрын
Best video to get grasp on beginner fundamentals of Provider package. Found very helpful Thank You😄
@nazmumasood4997
@nazmumasood4997 3 жыл бұрын
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.
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Writing this beautiful comment is much appreciated. Thank you! And you're welcome.
@dannykay4919
@dannykay4919 2 жыл бұрын
Amazing to see you depict the modules in the tree w/ the associated code, very cool!
@ubiux5994
@ubiux5994 4 жыл бұрын
Your channel is a pure treasure
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Appreciate that
@chetangoyal8466
@chetangoyal8466 2 жыл бұрын
Helped me a lot today. Thanks..
@FunwithFlutter
@FunwithFlutter 2 жыл бұрын
Pleasure!
@abhishekbhambure5146
@abhishekbhambure5146 3 жыл бұрын
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
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Thanks for the feedback! I guess all the info will be a lot to swallow if you're completely new to it.
@mysandyballs
@mysandyballs 4 жыл бұрын
One of the most concise and clear descriptions of Provider I have seen to date. I also learned about Selector and the ability to listen to multiple providers with one Consumer/Selector statement - amazing! Many thanks, and keep up the great work.
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Thanks mate! Really love getting feedback like this. There's a second video that I released after this one that goes into some of the other providers. You should check it out.
@DB-ho8cc
@DB-ho8cc 3 жыл бұрын
This video earned you a subscriber. Your presentation of this material was freaking flawless - better than Googles little video. Thank you.
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Thanks man! The video took me a while to make, so I'm glad it's helpful
@davebound268
@davebound268 3 жыл бұрын
The best info I've found on this so far - massive thanks
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
No problem 👍
@hiteshpandey8755
@hiteshpandey8755 3 жыл бұрын
Your explanation is better than the rest. You'll grow big for sure.
@Abhishvek
@Abhishvek 3 жыл бұрын
Hey! You should Also check this explanation😁kzbin.info/www/bejne/noO2pXSjoLmWgLs
@Caffeine81
@Caffeine81 4 жыл бұрын
Very helpful and boiled down to its essence. Keep it up!
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
That's the plan!
@mr.knight8967
@mr.knight8967 2 жыл бұрын
now flutter 3.0.1 is current version, but your provider still better and great, thank you
@mohammadamirnm
@mohammadamirnm 4 жыл бұрын
Your videos deserve more viewers!
@mikoaj1954
@mikoaj1954 2 жыл бұрын
perfect explanation, I really struggled to get this from articles, and this video came with help.
@FunwithFlutter
@FunwithFlutter 2 жыл бұрын
That's awesome to hear
@metamorphis7
@metamorphis7 3 жыл бұрын
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
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
That is amazing. You're very welcome :)
@dalanxd
@dalanxd Жыл бұрын
Amazing vid, thank you so much!!!
@sahilkamra2
@sahilkamra2 3 жыл бұрын
I got it in 7 minutes. Thanks
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Nice
@yashgutgutia604
@yashgutgutia604 3 жыл бұрын
Lmfao why doesn't this have more views! Simple, Expressive, Covers everything, Visually easy to understand!!
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Thanks Yash. Appreciate it. Remember spending a ton of time trying to make this video as compact and full of info as I can
@stephenoyeyo9176
@stephenoyeyo9176 4 жыл бұрын
Great video , keep them coming 💪
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Will do!
@shivamrathore8009
@shivamrathore8009 2 жыл бұрын
Very helpful
@blank-vw2sb
@blank-vw2sb 4 жыл бұрын
I appreciate it. Great content, man
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Thanks for all of the nice comments! Cheers
@blank-vw2sb
@blank-vw2sb 4 жыл бұрын
@@FunwithFlutter Cheers!! Good luck...
@Tibiafy
@Tibiafy 3 жыл бұрын
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
@shashankjamdade2224
@shashankjamdade2224 3 жыл бұрын
Really nice video....hats off man
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Why thank you!
@gowthammg3564
@gowthammg3564 4 жыл бұрын
best video on provider i have ever seen. keep going
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Sweet! You should check out the next one in this series. I think it's even better.
@gowthammg3564
@gowthammg3564 4 жыл бұрын
@@FunwithFlutter ya ill check that too.. Post more such advanced concepts in this way. Soon your channel will rock
@karanjhinga
@karanjhinga 4 жыл бұрын
Damn bro 😯 what a quality content 👌 u explained it better than there documentation.🎉
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
Thanks man!
@alexisenp
@alexisenp 4 жыл бұрын
Thanks 🙏🙏
@nowhynot7711
@nowhynot7711 3 жыл бұрын
Perfect Explanation, Perfect Video Editing , Perfect Example::: Awesome
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Thanks! :)
@erperejildo
@erperejildo 3 жыл бұрын
instead of using select on a param can we do something like Provider.of(context).myParam; or that's different?
@techstudio7331
@techstudio7331 4 жыл бұрын
Awesome
@eliepoun8814
@eliepoun8814 2 жыл бұрын
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 )
@FunwithFlutter
@FunwithFlutter 2 жыл бұрын
Great suggestion!
@adbysantos6603
@adbysantos6603 3 жыл бұрын
Good video, bro
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
You're welcome man
@hirakjyotiborah5687
@hirakjyotiborah5687 4 жыл бұрын
make a video playlist on flutter_bloc and it's usecase
@sankalpamokal9186
@sankalpamokal9186 2 жыл бұрын
How to call a method in initstate if we are using stateless widget in this architecture?
@1879heikkisorsa
@1879heikkisorsa 4 жыл бұрын
What's your opinion about the stacked architecture vs using plain provider state management?
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
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.
@1879heikkisorsa
@1879heikkisorsa 4 жыл бұрын
@@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?
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
@@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.
@adnanhaider9949
@adnanhaider9949 2 жыл бұрын
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
@danielchan1203
@danielchan1203 3 жыл бұрын
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?
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
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
@danielchan1203
@danielchan1203 3 жыл бұрын
@@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.
@dhruvajindal4932
@dhruvajindal4932 3 жыл бұрын
At 5:30 : What's difference between child and return in consumer ?
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
The child will be cached, so won't be rebuilt on each provider update
@dhruvajindal4932
@dhruvajindal4932 3 жыл бұрын
@@FunwithFlutter But the return is shown in the UI. So what is the child for?
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
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.
@euginium1539
@euginium1539 3 жыл бұрын
I feel stupid. I still don't understand when to use Consumer or Selector . Help
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
Just use Consumer :) always. Unless you only want access to one property on an object, then use Selector.
@samario_torres
@samario_torres 3 жыл бұрын
volume up in videos
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
You're right! I actually increased the volume for all of the vids after this one (I think). Anyway, the newer videos are louder.
@xtraszone
@xtraszone 2 жыл бұрын
// ! Provider CheatSheet // Step 1: Create Model class class Counter extends ChangeNotifier { int count = 0; void increase() { count++; notifyListeners(); } } // Step 2: Wrap root widget in MultiProvider, Also initialise Counter() here MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => Counter()), ], child: MaterialApp(), ) // Step 3: Read value final count = Provider.of(context).count; // Step 4: Write value Provider.of(context, listen: false).increase();
@ben6
@ben6 2 жыл бұрын
I had no idea that `context` was a member of `State`.
Provider: Proxy, Stream and Future in 6 Minutes
6:10
Fun with Flutter
Рет қаралды 12 М.
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 43 МЛН
Me: Don't cross there's cars coming
00:16
LOL
Рет қаралды 8 МЛН
Flutter BLoC Library Tutorial - Simple BLoC Pattern Solution
15:42
Change Notifier Provider Explained
14:32
Learn App Code
Рет қаралды 20 М.
Introduction to GetX | Flutter made easy
6:11
CodeX
Рет қаралды 66 М.
Flutter Provider - Advanced Firebase Data Management
11:08
Fireship
Рет қаралды 143 М.
Flutter Provider: The Essential Guide
17:12
Andrea Bizzotto
Рет қаралды 69 М.
Flutter Future (async, await)
2:48
HeyFlutter․com
Рет қаралды 18 М.
Se acabó la oferta para desarrolladores de Flutter?
1:46
HolaMundo
Рет қаралды 41 М.
How it feels writing your first program in C# versus python…
0:59
LeMaster Tech
Рет қаралды 156 М.