Flutter State Management - Basics of the Provider Package

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 64

  • @parallel_53
    @parallel_53 2 роки тому

    The John Rambo reference alone already deserves a thumbs up. Great videos.

  • @awesomelygeeky4519
    @awesomelygeeky4519 3 роки тому +14

    Simplicity at its best... Someone give this guy a 🏅🏅🏅🏅
    I've struggled with state management for a while and other UA-camrs are just downright confusing.
    Thanks man really. You've just earn yourself a subscribe

  • @dhruvvarshneydeveloper
    @dhruvvarshneydeveloper 2 роки тому +11

    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!!

  • @akhilkn225
    @akhilkn225 2 роки тому +1

    easy explanation
    please make a video on adding to Wishlist

  • @arunpraseeth9940
    @arunpraseeth9940 3 роки тому +10

    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.

  • @ReimeiNoRaimei
    @ReimeiNoRaimei 2 роки тому +1

    Thanks beyond Thank you,
    You explained a concept I've been having trouble with for a long time. Thank you very much!

  • @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.

  • @eskindergetachew4949
    @eskindergetachew4949 2 роки тому

    you debunked "curse of knowledge" ...bravo!! this is how you make a tutorial

  • @antoniojoseperessousa5045
    @antoniojoseperessousa5045 3 роки тому +8

    Fantastic explanation! Very simple and easy-to-follow example, perfect and paused diction. Thank you very much, sir!

  • @MrVipulLal
    @MrVipulLal 2 роки тому

    Long but clear video. Thanks

  • @jimaustin3608
    @jimaustin3608 3 роки тому +1

    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  3 роки тому +1

      Thanks, appreciate your comment.

  • @matejmichalek6115
    @matejmichalek6115 2 роки тому +1

    The best explanation for Provider. Thank you so much.

  • @dataluchs1288
    @dataluchs1288 2 роки тому +1

    You're skills to explain are top class! Best explanation I heard so far

  • @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 роки тому +1

    fantastic explanation!!!!

  • @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.

  • @adrycallencatapang7400
    @adrycallencatapang7400 3 роки тому +3

    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!

  • @Pedro-il8kx
    @Pedro-il8kx 2 роки тому

    Undoubtedly the best introductory video.

  • @xpwahab1
    @xpwahab1 3 роки тому +1

    This is one of the best explanations for Provider! 🙌

  • @resurrection355
    @resurrection355 2 роки тому

    great explanation!

  • @NuwanThisara
    @NuwanThisara 3 роки тому +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.

  • @gilangrakean9501
    @gilangrakean9501 2 роки тому +1

    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!

  • @DiyaLalDileepLal
    @DiyaLalDileepLal 2 роки тому

    very simple explanation. understood provide along with callback which was confusing for me. Thank you....

  • @mariagromova2119
    @mariagromova2119 2 роки тому

    Thanks for clear explanation !🙂

  • @julianc528
    @julianc528 3 роки тому +2

    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!

  • @dilansisitha4852
    @dilansisitha4852 2 роки тому

    really good video..thanks for the upload

  • @andrewmukelabai8209
    @andrewmukelabai8209 2 роки тому

    Excellent tutorial! You have a gift man. Cheers!

  • @iamsunnymac
    @iamsunnymac 3 роки тому +1

    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!

  • @mrnsbrown
    @mrnsbrown 2 роки тому

    Super helpful, well explained too Dankie!

  • @synapsetech129
    @synapsetech129 2 роки тому

    what an amazing explanation!!Thumbs up..Thank you very much.

  • @joaomarcosmatias6622
    @joaomarcosmatias6622 Рік тому

    Excelent explanation, very well!!!

  • @amalsunil4722
    @amalsunil4722 3 роки тому +1

    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 роки тому +1

      ​@@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 роки тому +2

      Thanks for the reply. Thats how you learn. Appreciate the reply and info.

  • @rahulrajeev9763
    @rahulrajeev9763 2 роки тому

    Excellent

  • @siddhantsaraf1218
    @siddhantsaraf1218 3 роки тому

    Again... an excellent explanation....loved it...

  • @jeffersonjohn5228
    @jeffersonjohn5228 2 роки тому

    best explanation

  • @awisadestiny5459
    @awisadestiny5459 Рік тому

    Well explained ❤

  • @kinoshan591
    @kinoshan591 3 роки тому

    Awesome explaining 👍

  • @madhan_gannarapu
    @madhan_gannarapu 3 роки тому

    Super explanation 👍

  • @yuvalw123
    @yuvalw123 3 роки тому

    Great explanation, thx !

  • @zahrayousefi9400
    @zahrayousefi9400 2 роки тому

    thank you so much

  • @nikhilkukreja8498
    @nikhilkukreja8498 3 роки тому

    God bless you Johan :)

  • @shanglee643
    @shanglee643 3 роки тому

    Keep going buddy!!!

  • @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?

  • @ramo_music1290
    @ramo_music1290 Місяць тому

    thak you very much ..... but i have just one question in the first example we could just creat an instance of the screen one on the screen Four than we could acces directy without passing from the other screens and with that we could also updat the data with a setstate

  • @coolmind230
    @coolmind230 3 роки тому

    super... Thank you

  • @naiduj-jd6sh
    @naiduj-jd6sh Рік тому

    Please upload video on block (using plugin)state management

  • @ComputerScienceAcademy5220
    @ComputerScienceAcademy5220 3 роки тому

    hey! you should do riverpod

  • @shakhawathossain3718
    @shakhawathossain3718 2 роки тому

    best

  • @adeolaodusami9311
    @adeolaodusami9311 11 місяців тому

    How is the elevatedbutton not part of the widget tree but the text widget is?

  • @nurdauletryspay6181
    @nurdauletryspay6181 3 роки тому +1

    Amazing tutorial, could you share your source code please?)

  • @NuwanThisara
    @NuwanThisara 3 роки тому

    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  3 роки тому +1

      Yes, in this example we do not save the state. You can check my SharedPreferences video on how to do that: ua-cam.com/video/v821-8FO4MU/v-deo.html

    • @NuwanThisara
      @NuwanThisara 3 роки тому

      @@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 роки тому +5

      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 :)

  • @danielbui12
    @danielbui12 3 роки тому

    Thanks so much