Flutter Provider Package In Depth - Change Notifier Provider

Sdílet
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

Komentáře • 93

  • @Opeyemi.sanusi
    @Opeyemi.sanusi Před 2 lety

    'I finally got that whole thing memorized' 😂. Now that's the kind of honesty we need from programmers

  • @Sauravgpt34
    @Sauravgpt34 Před 3 lety +1

    Really got goosebumps when I really realize that now I'm understanding the provider like a pro! Thank you so much 😍

  • @SublustrisRU
    @SublustrisRU Před 4 lety +5

    Дружище, огромное спасибо за твой труд! Это самое лучшее описание Change Notifier Provider из тех, что я нашёл. Точнее, единственное, изложенное простым и понятным человеческим языком. Спасибо огромное!

  • @acarvey
    @acarvey Před 3 lety +1

    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!

  • @ChristianJosephs
    @ChristianJosephs Před 4 lety +2

    great video keep them coming! 1-2 high quality videos like these per months would be really appreciated :)

  • @pruthvikumar2258
    @pruthvikumar2258 Před 3 lety

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

  • @Applf1tech
    @Applf1tech Před 4 lety +3

    good tutorial i haven't seen a flutter tutorial as clear and good as urs it really help me

  • @derencewalk
    @derencewalk Před 4 lety +1

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

  • @ZyroZoro
    @ZyroZoro Před 3 lety

    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!

  • @farhanmonsur8037
    @farhanmonsur8037 Před 4 lety

    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!

  • @firuzmhk9245
    @firuzmhk9245 Před 4 lety +1

    Great and clear concept of provider state management

  • @faizc9984
    @faizc9984 Před 3 lety

    Super clear explanation.
    I have gone through several provider tutorials, but this one is outstanding!
    Subscribed!

  • @noahrocks97
    @noahrocks97 Před 4 lety

    A timely and Informative upload as compared to other complex tidbits present. Keep it coming Andy :)

  • @talatkuyuk6556
    @talatkuyuk6556 Před 4 lety +14

    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.

  • @George-or3uv
    @George-or3uv Před 4 lety

    This tutorial is excellent, thank you for such a helpful and inciteful lesson.

  • @imranfauzi7752
    @imranfauzi7752 Před 4 lety +1

    For me, this is the best provider tutorial for beginner. Thanks man 👍

  • @nitinkumar7225
    @nitinkumar7225 Před 4 lety

    Very helpful. After a long search, an easy way to understand the concept. Good job !

  • @sercantor1
    @sercantor1 Před 4 lety +1

    this video helped me understand providers, thank you!!

  • @EditorConlee
    @EditorConlee Před 4 lety +1

    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.

  • @hokcheunghung7769
    @hokcheunghung7769 Před 3 lety

    Thank you Andy, this is the best tutorial of Provider for me

  • @patricksingrin2788
    @patricksingrin2788 Před 3 lety

    Just the right knowledge I need for my project. Thanks again for your nice tutorials.

  • @Hypothermia1337
    @Hypothermia1337 Před 3 lety

    This is one great example and fits perfectly into real world usage! Keep it up!

  • @mochilogic5358
    @mochilogic5358 Před 3 lety

    I appreciate your style of explaining things bro. Subscribed.

  • @wearecode9199
    @wearecode9199 Před 4 lety

    Very good tutorial - Provider based on Inherited Widgets , a very big concept to understand. Thank you !

    • @wearecode9199
      @wearecode9199 Před 4 lety

      Would love to see Provider With Consumers And Firebase as API please... not authentification though - just writing and getting data Please, thank you !

  • @mnuslaor3229
    @mnuslaor3229 Před 3 lety

    Awesome!!! It is very helpful, thank you!

  • @stefaandeconinck1531
    @stefaandeconinck1531 Před 4 lety +1

    Finally I get it, thank you, thank you, thank you.

  • @aakashparmar560
    @aakashparmar560 Před 3 lety

    Perfect tutorial for absolute beginners.

  • @wickedgummybear3104
    @wickedgummybear3104 Před 4 lety +6

    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.

    • @andyjulow4388
      @andyjulow4388  Před 4 lety +1

      That's great, I am glad to know these are helpful.

    • @purushottampk4530
      @purushottampk4530 Před 4 lety

      @@andyjulow4388 great and very helpful video .
      Please say about yourself

  • @nickb.7440
    @nickb.7440 Před 4 lety +1

    This is great thank you!

  • @AttiDavidson
    @AttiDavidson Před 3 lety

    Thank you very much for your work!

  • @sergiofranklin8809
    @sergiofranklin8809 Před 3 lety

    Amazing video, Thank you so much

  • @dingdong903
    @dingdong903 Před 2 lety

    Great video, thanks a lot!

  • @pdlraja3298
    @pdlraja3298 Před 4 lety

    Thank You Very Much Sir. This is great

  • @romeubeatotech
    @romeubeatotech Před 4 lety +1

    Great! Thank you!

  • @avdhootjadhav6705
    @avdhootjadhav6705 Před 3 lety

    Andy sir is the best 🔥🔥. I like watching your videos

  • @chrisogonas
    @chrisogonas Před 4 lety

    Quite helpful! Thanks

  • @subramaniams5589
    @subramaniams5589 Před 4 lety +1

    hi Andy, Nice tutirual! Between, Explain about the listeners (Consumers)

  • @ermiyaskasahun4796
    @ermiyaskasahun4796 Před 3 lety

    thanks. this is awesome

  • @nikhilkukreja8498
    @nikhilkukreja8498 Před 3 lety

    Thank you so much :)

  • @blueice1364
    @blueice1364 Před 3 lety

    Thank you sir.

  • @karimovitche
    @karimovitche Před 4 lety

    thank you !

  • @elgariusanimationstudio891

    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.

  • @nicolasfelipe1
    @nicolasfelipe1 Před 4 lety

    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.

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      I hear you. I am from a c#/Java background and I still drilling the idea of observables into my mind

  • @sichoi6297
    @sichoi6297 Před 4 lety

    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?

  • @ahmedalial-selmy895
    @ahmedalial-selmy895 Před 3 lety

    Keep going 🥰

  • @paulvickers8059
    @paulvickers8059 Před 4 lety

    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

  • @altered.thought
    @altered.thought Před 3 lety

    I liked and i subscribed. ✔

  • @humancyyborg
    @humancyyborg Před 3 lety

    Thank you so much for this tutorial. Please can you make the font size bigger

  • @houssamzeitoun8907
    @houssamzeitoun8907 Před 4 lety

    How would you go about testing these providers?

  • @zakirfaizal6321
    @zakirfaizal6321 Před 4 lety

    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.

  • @anirudhachakrabarty2050

    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.. 😍

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      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.

    • @EditorConlee
      @EditorConlee Před 4 lety

      @@andyjulow4388 I was thinking the same thing while watching, so I'm glad you acknowledged this. Thanks for the great tutorial.

  • @user-or7ji5hv8y
    @user-or7ji5hv8y Před 3 lety

    Can you do a video on Riverpod, if enough interest.

  • @Ali-hu8jr
    @Ali-hu8jr Před 4 lety +2

    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.

    • @andyjulow4388
      @andyjulow4388  Před 4 lety +2

      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.

    • @Ali-hu8jr
      @Ali-hu8jr Před 4 lety

      @@andyjulow4388
      Thank you, Andy. Glad to wait and watch your next video.

    • @biovawan
      @biovawan Před 4 lety

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

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      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.

    • @rajvaya9826
      @rajvaya9826 Před 4 lety

      @@andyjulow4388 waiting for steam provider video also add how to listen to continuous data

  • @user-or7ji5hv8y
    @user-or7ji5hv8y Před 3 lety

    great explanation. only thing is I wish the fonts were bigger.

    • @andyjulow4388
      @andyjulow4388  Před 3 lety

      Thanks, yes it took me a few videos to figure out the font thing.

  • @Chris-te7to
    @Chris-te7to Před 4 lety

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

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      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.

    • @Chris-te7to
      @Chris-te7to Před 4 lety

      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?

  • @aytunch
    @aytunch Před 4 lety

    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.

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      Just an oversight on my part. I've been working with streams too much lately and fell into the habit of leaving it off.

  • @T0phaz
    @T0phaz Před 4 lety

    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?

  • @vivek.tiwary
    @vivek.tiwary Před 4 lety

    Not able to view in 1080P, only 480P :(

  • @saicharansigiri2964
    @saicharansigiri2964 Před 3 lety

    1:18when you say refresh is it setstate

  • @utpalbarman6125
    @utpalbarman6125 Před 4 lety

    you deserve more subs, could u please make the fonts a bit larger? it'll be great for mobile users

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      I'm getting there. I bumped up the font size in my most recent videos. Thanks for that feedback.

  • @GuilhermeCarvalhoCarneiro

    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

    • @EditorConlee
      @EditorConlee Před 4 lety

      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.

  • @akarshs9552
    @akarshs9552 Před 4 lety

    Is provider sufficient for state management?

    • @andyjulow4388
      @andyjulow4388  Před 4 lety

      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

  • @jhonnysan6688
    @jhonnysan6688 Před 4 lety

    what is the loadPreferences();

    • @EditorConlee
      @EditorConlee Před 4 lety

      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.

  • @yandelyano
    @yandelyano Před 4 lety

    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.

  • @dhikshithrm
    @dhikshithrm Před 3 lety +1

    i want 5x playback speed.....

  • @dineshahuja5955
    @dineshahuja5955 Před 3 lety

    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 🙏

    • @andyjulow4388
      @andyjulow4388  Před 3 lety

      I hear you Dinesh. I did in later videos but was still figuring it all out when I recorded this one.

  • @akshay6019
    @akshay6019 Před 4 lety

    Next time please increase font size

  • @fmahmohammadi8858
    @fmahmohammadi8858 Před 3 lety

    wtf is with the intro man