Flutter Riverpod Tutorial - The Better Provider

Поділитися
Вставка
  • Опубліковано 4 лют 2025
  • 📗 Learn from the written tutorial 👇👇
    resocoder.com/...
    📧 Get Flutter news 📰 and resources:
    👉 flutter.education
    👨‍💻 Do you write good code? Find out now!
    resocoder.com/...
    Riverpod is the response to all the insufficiencies of other dependency injection and state management packages for Dart & Flutter apps. It's quick to get familiar with, maintainable, testable and it's much less error-prone than the other solutions out there. Let's take a look at the core principles of Riverpod.
    Go to my website for more information, code examples, and articles:
    ● resocoder.com
    Follow me on social media:
    ● / resocoder
    ● / resocoder
    ● / resocoder

КОМЕНТАРІ • 145

  • @ianjaspersantos8915
    @ianjaspersantos8915 4 роки тому +61

    Time for riverpod playlist!!!

  • @MatuellaSlipknot
    @MatuellaSlipknot 4 роки тому +43

    I am always impressed by your arguments when teaching stuff. Hearing “one of the problems with Provider is injecting dependencies through the UI”, may not seem like much, but it has a deeper meaning that you have, at least, tried to build real production apps, with a well-designed architecture (followed your clean architecture tutorials as well, just as awesome as this one). This is what the community needs.
    Being a flutter dev that works on full scale production projects, I can see that your arguments discuss non trivial issues of real (reads production) architecture applications, unlike almost all other flutter tutorials. Thanks a lot!

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 6 місяців тому

    best explanation I have found on this topic on youtube.....thanks

  • @hengideguru
    @hengideguru 4 роки тому +18

    You're the best!! Looking forward for a TDD + CleanArchitecture + Riverpod series!!!

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

    This is the best tutorial for riverpod on UA-cam. Thank you

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

    If you’ve stumbled around the web copying code as the ‘instructor’ builds an app, and (like me) wondered if anyone TEACHES … lucky you, you’ve found him! Matt (Reso Coder) is hands-down the best teacher I’ve found, in terms of presentation, depth, topics, and his intent for students to write flutter apps professionally.

  • @richardharris9708
    @richardharris9708 3 роки тому +7

    Thanks for the tutorial, it's really easy to understand.
    One thing about ref.watch vs. ref.read, the Riverpod docs suggest always using ref.watch where possible. Because even if you think a variable will never change, it might change in the future and cause bugs that are hard to debug.

  • @puhgeh
    @puhgeh 4 роки тому +12

    damn! this riverpod is cleaner to implement than provider! time to refactor my project. thank you!

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

    Fantastic teaching on Riverpod, thank you very much!

  • @mahadylol
    @mahadylol 4 роки тому +10

    Need tutorial on clean architecture with riverpod that can be used on big application.

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

    you made a day...thanks for beautiful explanation...

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

    Next. Level. Remi made some good work here, I love it. You explain it very well, needed this.

  • @robsonsilv4.
    @robsonsilv4. 4 роки тому +6

    Wow, 40 minutes about Riverpod 🥳

  • @athinavandame
    @athinavandame 4 роки тому +2

    I needed this sooo badly. Thank you so much!!! So glad I discovered you

  • @cptsakamoto
    @cptsakamoto 4 роки тому +2

    Thank you very much for the video. Can we expect the architecture of the app using Riverpod

  • @stephio76
    @stephio76 4 роки тому +1

    Very nicely explained! I was waiting for such a good Riverpod tutorial. I hope you will continue with some more deep dives. Thank you!

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

    Gracias por compartir este conocimiento, en este momento voy a implementarlo en un proyecto que estoy desarrollando. Éxitos en todo lo que hagas!!!

  • @truth722
    @truth722 4 роки тому

    Yeah~ Riverpod!!! 🎉🎉 Hope to see more videos about how to implement riverpod in upcoming applications! Thank you Matt!

  • @rydmike
    @rydmike 4 роки тому

    Nice to see you back with this type of video and written tutorial combo Matt. Excellent arguments and explanations of what benefits Riverpod offers over POP (Plain Old Provider 😀). Looking forward to more in-depth tutorials on Riverpod. 💙

    • @ResoCoder
      @ResoCoder  4 роки тому +1

      Thanks! I'm stealing that abbreviation from now on lol!

    • @rydmike
      @rydmike 4 роки тому

      Thought it would go nicely together with PODO and POJO 😀

    • @mallikarjunreddy5229
      @mallikarjunreddy5229 4 роки тому

      @@ResoCoder Me too :)

  • @thebeststuff5522
    @thebeststuff5522 4 роки тому +3

    Better than bloc. ? Which one to use? I'm using bloc for last 6 months.

  • @mibi2007
    @mibi2007 4 роки тому +1

    This is what I wait for longgggg time, love you Matt :D

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

    Excellent

  • @carlswanson6746
    @carlswanson6746 4 роки тому

    Excellent tutorial. Thanks Matt! Riverpod looks like a nice step forward. I'll probably convert once it is released/stable.
    One minor note regarding your comments at the beginning about ugly nesting of Providers in the original 'provider' package: 'MultiProvider' already deals with that problem, so your use case is a little unrealistic for that particular comparison.

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

    Thank you very much ! This is great !

  • @Saketjsaket
    @Saketjsaket 4 роки тому

    Thank you so much for your tutorial.

  • @daviidon
    @daviidon 4 роки тому +1

    I like that this solves the look up problem but I'm leaning more towards cubit and freezed. Definitely looking forward to a more comprehensive example.

    • @MatuellaSlipknot
      @MatuellaSlipknot 4 роки тому +2

      My main problem with cubit and blocs is the one that Reso mentioned in the beginning: you have to mix dependencies through your UI/presentation layers.
      I have worked in 3 production projects and 2 are using provider and blocs (one uses cubit only because it was released recently), and it leaks so much of the dependency, that it is almost impossible to apply dependency inversion and encapsulate views-only responsibilities.

  • @LeCrowTV
    @LeCrowTV 4 роки тому

    Thank you so much for this tutorial

  • @abraiyan7984
    @abraiyan7984 4 роки тому

    Oh yes. I always wanted a provider tutorial from you and now I have it :D

  • @oliverfunk
    @oliverfunk 4 роки тому

    Great tutorial Reso, as always.

  • @FurqanaFathuzzaman
    @FurqanaFathuzzaman 4 роки тому +1

    This is awesome! Would love to see how to use it in a DDD structure

  • @randomusername982374
    @randomusername982374 4 роки тому

    Goodbye provider. Thanks for showing this

  • @enafor99
    @enafor99 4 роки тому +2

    Thank , aweasom tutorial, can you use Riverpod in an clean architecture project ? thanks so much

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

      I have the same questions. Has anyone tried?

  • @lincolnzhou9611
    @lincolnzhou9611 4 роки тому

    Great job 👍

  • @GroovinChip
    @GroovinChip 4 роки тому

    Excellent tutorial and explanations, great work!

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

    Hey would you say its worth adapting riverpod over bloc in a new project?

  • @gligoratanasovski3329
    @gligoratanasovski3329 4 роки тому

    Good explanation. I like this copy-paste code technique more than Fireship's one.

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

    One easy solution using the original provider package is to define subtypes that you can pass to the generic. Same effort as declaring global variables, no? Plus it results in clearer data model. BUT I like that Riverpod removes provider widgets from the tree. 🤓

  • @mohamadosama9797
    @mohamadosama9797 4 роки тому +3

    thank you reso Perfect ,,, i just want to ask you about the color theme that you are using with vs code

  •  4 роки тому +1

    Awesome content, thanks for sharing ⚡

  • @yazidkrayem7408
    @yazidkrayem7408 4 роки тому +2

    Which is better Bloc or Riverpod for state management?
    Thank you for sharing.

    • @youtornado
      @youtornado 4 роки тому +1

      You can actually use Riverpod to provide BLoCs to your widgets...

    • @ResoCoder
      @ResoCoder  4 роки тому +9

      You can use StateNotifier which comes bundled with Riverpod. It's very similar to Cubit. A tutorial on that is coming!

    • @AdamSmaka
      @AdamSmaka 4 роки тому

      @@ResoCoder can't wait 🤗

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

      @@youtornado and ResoCoder, do you still prefer Bloc over ChangeNotifier or StateNotifier?

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

    Great content!!

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

    How dislike this type of video? why?
    Thanks for the explanation

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

    Hi Matej! Could you cover the state management/dependency injection called GetX?

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

    i liked it, thanks

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

    Hello and thank you for your tutorial.
    I am developer who uses Cubit and am curious how do you think these 2 compare?
    It seems, to me, that Cubit/Bloc is better at separating the logic of the app from the UI as is more pattern like: you have a logic class (the cubit) and the state class.
    Riverpod seems, again to me, to be all over the place and it entangles with the UI a bit to much.

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

    Awesome. ScopedReader is deprecated. Other stuff is amazing and covers the basics.

  • @aadarshainfo3535
    @aadarshainfo3535 4 роки тому +2

    I was thinking of learning bloc. Should I skip it and learn riverpod?

  • @MohamedDernoun
    @MohamedDernoun 4 роки тому +1

    I hope you continue to use TDD on all your video tutorials :)

  • @mercatellineto
    @mercatellineto 4 роки тому

    Best tutorial!

  • @JETLAI123
    @JETLAI123 4 роки тому +1

    Excellent tutorial and hoping the next would be talking about States_rebuilder, it changed a lot since last tutorial.

  • @vanvicka1
    @vanvicka1 4 роки тому +1

    would have love to see how this would fit into that numbertrivia app or any architecture

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

    Great explanation, many compliments!!! Linear, progressive and very well commented, the best tutorial for the introduction to the great package flutter_riverpod

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

    What theme are you running for VScode? And what extension to get the widget tree bars?

  • @h3w45
    @h3w45 4 роки тому

    Well done.

  • @gharbiesstt1
    @gharbiesstt1 4 роки тому

    Thanks for this

  • @robsonsilv4.
    @robsonsilv4. 4 роки тому +4

    What's the best location to put global provider's (dependency injection)? In main, sperated file...

    • @ResoCoder
      @ResoCoder  4 роки тому +4

      I put them into a file called "providers.dart". If you have just way too many providers and a single file would get out of hand, you can create provider files per feature of the app.

    • @TheBadFred
      @TheBadFred 4 роки тому +1

      @@ResoCoder So you have to import them in every file that you need them? Is there some example in a git-repo?

  • @freewolf4290
    @freewolf4290 4 роки тому

    great thanks very much

  • @burakbirer5938
    @burakbirer5938 4 роки тому +1

    Thank you for these amazing videos and articles. It would be great to learn more about Riverpod in action from you. Btw I would absolutely join if you start a Udemy course. Best Regards,

  • @leo_and_his_bikes
    @leo_and_his_bikes 4 роки тому

    Amazing! Thanks

  • @easazade
    @easazade 4 роки тому

    you can use injectable annotation processor with getit

  • @marekchojecki4746
    @marekchojecki4746 4 роки тому

    Awsome video as always

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

    Thank you! What's the extension giving you the dotted lines to show the nesting?

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

      It's a vscode setting, something to do with guidelines I think

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

    Thanks sir

  • @marcelplummer3536
    @marcelplummer3536 4 роки тому

    Game changing

  • @SamSam-rg4lk
    @SamSam-rg4lk 3 роки тому +1

    context.read doesn't work with flutter_riverpod 1.0

  • @bumble2685
    @bumble2685 4 роки тому

    Thanks for the video, great content. 1 question tho:
    Why are you putting a regular provider inside the future provider? Can't we just skip the regular provider and create the http request inside the future provider?

  • @prexx8953
    @prexx8953 4 роки тому +1

    Whats the difference using a simple Provider instead of a global variable? Wouldn't it be the same?
    Like:
    final constString = 'constant string';
    and
    final providerString = Provider((ref) => 'provider string');

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

      The latter can be mocked easier, using overrides.

  • @himesh_89
    @himesh_89 4 роки тому

    Thanks

  • @TechWithDnes
    @TechWithDnes 4 роки тому +1

    Wow.. More on Riverpod

  • @jaimepremy
    @jaimepremy 4 роки тому

    Have you taken a look at GetX?

  • @wisnuwiry
    @wisnuwiry 4 роки тому +1

    Please make tutorial Flutter with Modularization, make module is independent.
    Thanks

  • @JJ-rn9zl
    @JJ-rn9zl 4 роки тому

    Do riverpod support data streaming?

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

    How do I read futureprovider? I never enter the .when method inside onpressed functions with futureproviders

  • @akshay6019
    @akshay6019 4 роки тому +1

    More riverpod tutorial

  • @cedvdb6473
    @cedvdb6473 4 роки тому

    What about using bloc with riverpod ?

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

    can riverpod be use in large scalable project ?or we should bloc? Bloc ia too complicated to understand

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

      I use Riverpod in all production-grade apps I build nowadays.

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

      @@ResoCoder does riverpod suits for large scalable project like ecommerce, hospital appointment system?

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

    Hello. I started watching tutorials yesterday. Can I skip learning Provider and jump to Riverpod instead? Is it okay? Thanks

  • @janek727
    @janek727 4 роки тому +8

    When time for GetX? 🖤😄

    • @hassanosama357
      @hassanosama357 4 роки тому

      Hahahah same

    • @poomchantarapornrat5685
      @poomchantarapornrat5685 4 роки тому +2

      I use GetX as the dependency injection with Bloc. It’s PERFECT. I no longer using any Provider(), need context to get the bloc, and can easily create and delete the Bloc instance from anywhere in the app. GetX can construct Blocs as a singleton too. I gain more power of dependency injection from GetX but still remain the testability from Bloc.

  • @lukassimon8324
    @lukassimon8324 4 роки тому

    Interesting for sure, but would you mind do some more comparison provider - riverpod? So far it feels really similar... Also for some reason even after the explanation it feels really weird to have bunch of global vars just hanging there instead of putting them inside the widget tree.

  • @musliminontong2918
    @musliminontong2918 4 роки тому

    can I use Bloc provider with Riverpod?? @resocoder?

  • @ReelSkilla
    @ReelSkilla 4 роки тому

    Riverpod/Firebase series pls :)

  • @Nobody-ky7sl
    @Nobody-ky7sl 4 роки тому

    Finally riverpod

  • @flutterdev8703
    @flutterdev8703 4 роки тому

    Would be GREAT to have a tutorial with Riverpod that consume real Data from an API, just as it is in real life work situation (not firebase aye but Services, Repos, Riverpod, UI)

  • @TheBadFred
    @TheBadFred 4 роки тому +2

    Do you work with only one dart file? If you work with many dart files, you will have to globally create a provider in every file so you can reference it in the build function? I currently use GetX and this way more comfortable and much easier to use even routing is a breeze. The docs on Riverpod are hard to follow and are all over the place.

  • @faheemahmadofficial7701
    @faheemahmadofficial7701 4 роки тому

    please make a easier and digestable beginner tutroial for fluter

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

    Awesome tutorial! I noticed that you're using windows. How do you test your apps for the ios enviroment?

  • @vaibhavdangayachvd
    @vaibhavdangayachvd 4 роки тому

    How can we achieve something like buildWhen

  • @mehulbisht9708
    @mehulbisht9708 4 роки тому

    So is flutter used as much as native android now? I've been doing it for a week now but idk how to store data for android and web like native android has sharedpreferences or room for storing a string.

  • @vaibhavdangayachvd
    @vaibhavdangayachvd 4 роки тому

    Perfect 😍😍😍

  • @joaomaia9140
    @joaomaia9140 4 роки тому

    Bloc vs Riverpod?

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

    32:15 🔥

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

    Riverpod in 40min!!!

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

    download?

  • @Michael-rc5ks
    @Michael-rc5ks 3 роки тому

    I kind of don't understand. So when using riverpod, you're supposed to leave global variables around the codebase? Won't that be worse than provider base?

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

      They are global variables in the same way that classes are global. Instantiated classes (objects) are local to their scope. The same goes for objects provided by Providers.

  • @AkshayBhange
    @AkshayBhange 4 роки тому

    now we need provider vs riverpod vs bloc video

  • @joaquingumucio2758
    @joaquingumucio2758 4 роки тому +3

    Riverpod or Bloc?! I'm extremely confused!

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

    What‘s the plugin for `=>` called?

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

      Hope you know it now. If you don't, these are called Font Ligatures. They are available in official Jetbrains Mono font, Fire Code font, etc. In Android Studio, it can be enabled under Preferences > Editor > Font.

  • @purushottampk4530
    @purushottampk4530 4 роки тому

    How to achieve DI using reverpod like getIt.

    • @mwoelmer
      @mwoelmer 4 роки тому +1

      In the video he had a provider that provided the FakeHttpClient() object. This can be a real http client or anything else that you would want to inject into your app. Using the ref variable on a provider you can access other providers establishing dependencies.

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

    Yo can you send the vscode theme and font please 🙂

  • @banglafactsteller6780
    @banglafactsteller6780 4 роки тому

    which app series coming next !!!