Provider State management - ChangeNotifier + Flutter

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 54

  • @mivoligo
    @mivoligo 4 года назад +34

    Let's say we need 3 providers for one widget. So instead of wrapping a widget with Consumer with Consumer with Consumer... we can wrap it with 'Consumer3' for example like this:
    Consumer3(
    builder: (context, oneProvider, anotherProvider, thirdProvider, child) {
    return MyCustomWidget(
    someValue: oneProvider.someValue,
    anotherValue: anotherProvider.importantValue,
    oneMoreValue: thirdProvider.somethingElse,
    );
    }
    According to documentation we can go up to Consumer6 like this.

    • @FlutterExplained
      @FlutterExplained  4 года назад +8

      That solves a lot of problems, thank you for sharing. I will pin it to the comments section so everyone will see it early. To make it easier readable, here is a carbon link: carbon.now.sh/k4Sf4SWoqQurH3oXHwEk

    • @ShafqatNadeem
      @ShafqatNadeem 3 года назад

      thanks mivoligo

  • @Toasticuss
    @Toasticuss 4 года назад +13

    Visualizing or diagramming the problem and visualizing the solution before jumping into coding would make your videos a lot easier to me.

    • @FlutterExplained
      @FlutterExplained  4 года назад

      That sounds like a great idea, thanks for the feedback I try to create a fitting diagram for the future videos.

  • @hemishpancholi
    @hemishpancholi 4 года назад +2

    The video was very good. was able to understand the provider in seconds. I would suggest everyone see this video.

    • @FlutterExplained
      @FlutterExplained  4 года назад +1

      Fantastic, I love that it helped you.

    • @hemishpancholi
      @hemishpancholi 4 года назад +1

      @@FlutterExplained And also for VSCode we can use Pubspe assist extension for adding a package. It becomes so simple to add it. Just cmd+P and search Pubspec assist add the dependency. And type the name and done.

  • @atlantis_expedition_member4747
    @atlantis_expedition_member4747 4 года назад +3

    This is the best provider video I watched. Using the todo as a teaching method made it really easy to understand provider. Keep using it and the zoom level on the code.

    • @FlutterExplained
      @FlutterExplained  4 года назад

      Thanks for your feedback it is super motivating :).

  • @makemypetgamedevprocess6475
    @makemypetgamedevprocess6475 3 года назад +1

    FINALLY AFTER SO MUCH BLOC AND SETSTATE I CAN USE PROVIDER-PERFECTLY EXPLAINED!! :)

  • @delwarhossain43
    @delwarhossain43 2 года назад +1

    Nice. Good teacher. Thanks a lot. from Bangladesh.

  • @DavidHust
    @DavidHust 4 года назад +1

    Thank you for making this. It took me multiple videos but this one really helped make sense of it all. Appreciated.

  • @adamcierniak3902
    @adamcierniak3902 4 года назад +2

    Excelent video. So far I have used callback functions and "passing data by refernece" but this looks nicer.

  • @fazilkilicf
    @fazilkilicf 4 года назад +1

    I watched many tutorial videos but got it in this video. Thanks man!

    • @FlutterExplained
      @FlutterExplained  4 года назад

      Great! I am really happy that it worked for you.

  • @deoneloff
    @deoneloff 4 года назад +2

    Very good explanation and presentation!! Many thanks

  • @onuaugustine7276
    @onuaugustine7276 2 года назад

    wow, nice video. I like the way you explained everything clearly. Thank you.

  • @kobi665
    @kobi665 3 года назад +1

    Great explanation!

  • @iamsusmitashrestha
    @iamsusmitashrestha 4 года назад +1

    Thank you for making this video.I liked the step-wise process.Easy to visualize

    • @FlutterExplained
      @FlutterExplained  4 года назад +1

      Thank you I will try to keep it like that and bring more of this step to step tutorials :)

  • @rahultirkey7950
    @rahultirkey7950 4 года назад +1

    Thanks for making this tutorial. Its clear my doubts.

  • @supermath3491
    @supermath3491 3 года назад +1

    thanks man for the example it was so clear keep on

  • @Raimkhodzhanov
    @Raimkhodzhanov Год назад

    Thank You! It was very interesting!

  • @askmrmoses
    @askmrmoses 2 года назад

    Great explanation

  • @hardiklakhalani6268
    @hardiklakhalani6268 2 года назад

    Finally, I understood Provider Flow! Thanks a lot, Sir for TODOs method. 👍🏻 👍🏻 LIKED & SUBSCRIBE.

  • @fidamuntaseer1989
    @fidamuntaseer1989 4 года назад +1

    Very clear explanation...thanks... :)

  • @saidisa5956
    @saidisa5956 2 года назад +1

    Great episode! I liked how you explain every line you write, not too fast, not too slow, perfect base. just excellent!
    BTW, if my list is built from firestore, should I use change notifier provider (with subscription) or stream provider ?

    • @FlutterExplained
      @FlutterExplained  2 года назад +1

      Very good question, in general you can do both, but because you receive a stream from Firebase usually it is easier to directly use the Stream Provider.

  • @francescofreddi4374
    @francescofreddi4374 4 года назад +1

    best explanation that i see on youtube! how much video there is :(

    • @FlutterExplained
      @FlutterExplained  4 года назад

      Wow, thanks! I am really happy that it helped you :)

    • @francescofreddi4374
      @francescofreddi4374 4 года назад

      @@FlutterExplained can i ask where i can find some official documentation about Flutter?
      i have some deep questions about Provider package...
      pub.dev/packages/provider here is not complete; i need a list of how much provider there is (such FutureProvider, StreamProvider... and so on).
      If cannot have a complete prospect of whats there are, how much i can do with all those different provider, i cannot use in a very confortable mode.........
      And now there is my super deep question:
      in a Flutter project, if i want to a simple Stream;
      how can I spread it in a widgetTree? If i use Provider instead StreamProvider.... or i use Provider to spread a Future results?????
      There is some problem???
      ThankSoMuch!

  • @yvesfricker5498
    @yvesfricker5498 3 года назад +1

    Great, thank you very much!

  • @leonvanrijswijk8409
    @leonvanrijswijk8409 4 года назад +1

    Thanks. Nice example. Looking forward to the Riverpod-video. But could you also make a video like this on the ProxyProvider and also how that is implemented in Riverpod? The TODO's are helpful by the way.

  • @adbysantos6603
    @adbysantos6603 4 года назад +1

    Thanks for the video :)

  • @lorenbeall147
    @lorenbeall147 4 года назад +1

    thank you, nice content

  • @waltherleonardo8652
    @waltherleonardo8652 2 года назад

    great video. It help me a lot.
    However, I think that the app in the video is still working with the setstatescreen instead of the provider screen where we were working on

  • @dhanniekristanto
    @dhanniekristanto 4 года назад +1

    Would you recommend provider state management for firebase app?
    I used it for my project and i'm not sure if I done it right by putting the provider inside a stream builder. All the example for the provider read and watch method is always triggered by onPressed or onValue changed event. But what is the event of new incoming stream called?

    • @FlutterExplained
      @FlutterExplained  4 года назад +1

      That is a fantastic question. The event of a new incoming stream is going through the listen to the function of the stream itself, inside of that you can access the value of the stream and call the provider method that you want to execute. Alternatively you can use the await ... for loop for the stream to fulfil and handle the change.

  • @sankalpamokal9186
    @sankalpamokal9186 3 года назад

    How to call initstate if we are using stateless widget in this architecture?

  • @altearjen6838
    @altearjen6838 3 года назад

    would like to see an example with an auth provider, specifically for firebase

  • @GuilhermeCarvalhoCarneiro
    @GuilhermeCarvalhoCarneiro 4 года назад

    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

  • @AshishKumar-kx2ho
    @AshishKumar-kx2ho Год назад

    Can you make a video on hook in flutter.