Riverpod State Management

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 88

  • @vatan2578
    @vatan2578 4 ปีที่แล้ว +7

    You are a good person. I wish you and your loved ones health and happiness.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      KENAN DEMİR thank you very much! I really appreciate it 😊

  • @RobertBrunhage
    @RobertBrunhage 4 ปีที่แล้ว +6

    Great video! Those editing skills are starting to show I see!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      Robert Brunhage haha slowly but surely 😊

  • @blueice1364
    @blueice1364 4 ปีที่แล้ว +1

    Thank you soo so much... I have been searching for an easy to understand riverpod video, and this is the one that made most sense.
    Thank you.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      My pleasure 😊 glad I could help

  • @khanisrarahmedalihusain
    @khanisrarahmedalihusain 4 ปีที่แล้ว +1

    Great video, I saw lots of video about riverpod, but didn't get. You explanation is amazing. Thank you so much.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Khan Israr Ahmed Ali Husain thank you! That means a lot 😊

  • @andredealbuquerque7699
    @andredealbuquerque7699 4 ปีที่แล้ว +3

    Testing is very important! Just found your channel and started learning how to code recently. Do more of those for sure :)

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Nice, good luck on your coding journey 😊

  • @silverCap00
    @silverCap00 3 ปีที่แล้ว

    Good lecture! Always very very very very thanks to you!

  • @quicksketch1617
    @quicksketch1617 3 ปีที่แล้ว

    TH-cam have a lot of tutorials, this is very good for those that are learning and doesn't have much programming experience

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thank you so much 😊

  • @elistark9264
    @elistark9264 4 ปีที่แล้ว +1

    Amazing explanation!

  • @sunritjana4573
    @sunritjana4573 4 ปีที่แล้ว +3

    Haha, even though I am dumb, when it comes to flutter, this was an amazing explanation, and i really love it!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Sunrit Jana thank you! I really appreciate it!!

  • @Lensbreak
    @Lensbreak 3 ปีที่แล้ว +2

    Best Riverpod starter tutorial on youtube, thanks a lot. One question: Do you know why my hotreload via android studio doesnt work whenever I change something in the providers.dart file? The app restarts but nothing works, even the circular indicators are stuck and not showing properly. have to close the app and clear cache every time, only then things work.

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      That's really weird. Whenever working within the providers, I sometimes need to hot restart, but that is because there is a different provider in cache than the new one that I updated

    • @renanmendes35
      @renanmendes35 3 ปีที่แล้ว

      I was having a similar issue with any of my flutter apps. Solved running app (even on debug mode!) using VsCode --> Run --> Run Without Debug. Of course this only applies if you're using VSCode too... With Android Studio everything always worked out for me.

  • @otolulope
    @otolulope 4 ปีที่แล้ว

    Guy, you are the best.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Thank you!! I am planning another Riverpod video soon

  • @jd31068
    @jd31068 4 ปีที่แล้ว +1

    Thanks, good video.

  • @lukesecomb
    @lukesecomb 4 ปีที่แล้ว +2

    Any reason why you might choose ChangeNotifierProvider over StateNotifierProvider? They seem to do pretty much the same thing?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +3

      StateNotifier is immutable, while ChangeNotifier is mutable. Depends which one you prefer

    • @lukesecomb
      @lukesecomb 4 ปีที่แล้ว +2

      @@tadaspetra ah right. good to know the difference. thanks for the reply.

    • @Lensbreak
      @Lensbreak 3 ปีที่แล้ว

      exactly my question thanks haha

    • @aymanhamedmoustafa
      @aymanhamedmoustafa 3 ปีที่แล้ว

      I think you may use ChangeNotifier if you want to listen to more than one variable

  • @TheGaoNan
    @TheGaoNan 4 ปีที่แล้ว +1

    Dear Tadas,
    The Stream you've shown here is left open, how can i make sure once the stream reaches 5 as the number, to close it?
    Thanks!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      In a real scenerio, you should probably uses statenotifier or changenotifier, with a stream state and you can have methods in those that cancel the stream

  • @fauzytech
    @fauzytech 4 ปีที่แล้ว +1

    Hi, what a nice video! have you ever found any issue with unit test for both GetX and Riverpod? What do you think about which one of them that is easier to test?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      So I haven’t worked with Riverpod and testing yet. But to be honest I think both of them would be pretty easy to test. The fact that it is a state management solution makes testing easier because you can load specific states in.

  • @NabilDesignz
    @NabilDesignz 4 ปีที่แล้ว +1

    Do you recommand a particular state manager when we use graphql for flutter?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      I haven’t actually used graphql so idk if I’m the best person to give advice for that

  • @abe10
    @abe10 4 ปีที่แล้ว +2

    Hey man, I've been thinking about learning a state management framework for flutter. Looking at your channel there are many videos on the topic but which one would you recommend starting with?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +4

      Abhishek Rawat to start with I would try GetX. It is the simplest one for sure. Then the flutter recommended is Provider, but it has a couple nuances that I dislike. So I would go with Riverpod over that. So Riverpod or GetX in my opinion are the ones I would use

    • @abe10
      @abe10 4 ปีที่แล้ว +1

      Thanks!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Abhishek Rawat no problem!

    • @meansnada
      @meansnada 4 ปีที่แล้ว +1

      @@abe10 Riverpod for sure.

    • @abe10
      @abe10 4 ปีที่แล้ว

      @@meansnada Hey man, thanks!

  • @aakashr79
    @aakashr79 4 ปีที่แล้ว +1

    Is there any difference between the different types of state management in terms of performance? Like is one fatster/more efficient than the other in some cases and vice versa?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      Indrajit Roy there probably technically is a difference. However, it will be a very small difference that should not affect any noticeable performance

    • @aakashr79
      @aakashr79 4 ปีที่แล้ว +1

      @@tadaspetra Right. Thanks!

  • @dantedt3931
    @dantedt3931 3 ปีที่แล้ว

    0:00 Your last what?

  • @rounaktadvi4950
    @rounaktadvi4950 3 ปีที่แล้ว

    Which VS Code theme you use?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      It’s called Pitch Black

  • @purushottampk4530
    @purushottampk4530 4 ปีที่แล้ว +1

    Can we create stateProvider of String?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      yes you can 😊

  • @girishparate6410
    @girishparate6410 4 ปีที่แล้ว +1

    flutter hooks is 3rd party packge or by Google ?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      It's another package by Remi (the guy that made Provider), but rumor has it, Google might add it into Flutter itself

  • @tinchocbaar
    @tinchocbaar 4 ปีที่แล้ว +3

    GetX or Riverpod ???
    this is the question!!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      haha they are both great! I think depends what you are looking for. I like the structure of GetX and the simplicity, but I also like the safety of riverpod

    • @tinchocbaar
      @tinchocbaar 4 ปีที่แล้ว +3

      @@tadaspetra
      watch your video quickly !! when you say "security" you mean the states data: loading: error: in for example the Future ??

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      Martin Melchior yes. With Futures and Streams it covers all the cases and gives an error if you are missing one

    • @shermanchu5588
      @shermanchu5588 4 ปีที่แล้ว +1

      I prefer getx as it reduces code size

  • @billiardoxx
    @billiardoxx 4 ปีที่แล้ว

    As you have used GetX and Riverpod, could you explain pros and cons of each of them? Why should we choose one of them? After your video I think GetX is more easy to use.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +3

      I basically recommend this, GetX is easier to learn and great for beginners, but Riverpod has a lot of nice features and makes your code safer. So if you are a beginner or want simplicity go with GetX, if you are confident in your skills and would like these nice features try out riverpod

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      End of the day whatever one works best for you is the one to stick with!

    • @billiardoxx
      @billiardoxx 4 ปีที่แล้ว

      @@tadaspetra Ok, I agree with that, BUT how does Riverpod make your code safer? can you explain it in more detail? Thanks.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +4

      @@billiardoxx I actually just put out a new video on it. But for example if you use a future provider, you HAVE to handle loading and error states, or else Riverpod will show you a warning

  • @twobits7310
    @twobits7310 3 ปีที่แล้ว

    I am new to development, I have a question, is state management and architecture pattern two different things?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Yes. State management is a how you maintain state throughout your application. Architecture pattern is how the whole application is laid out. They are tied together very often because how you manage state will dictate how your app architecture is laid out. Basically good architecture patterns USE state management.

    • @twobits7310
      @twobits7310 3 ปีที่แล้ว

      @@tadaspetra how many architecture patterns for flutter? (Suitable for flutter)

  • @aviatorin
    @aviatorin 4 ปีที่แล้ว +1

    Riverpod with Statefulwidget?? can u pls explain

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      So you don't really need to use StatefulWidget when you're using Riverpod. If you wrap all the things that actually change within a provicer, then it should be handled.

  • @akshay6019
    @akshay6019 4 ปีที่แล้ว +1

    Can you do a tutorial on calling native code/plugins from flutter also dart ffi

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      Mr Random this is a topic I've been meaning to look into!

  • @najafsikander8760
    @najafsikander8760 4 ปีที่แล้ว +1

    I saw your testing videos bro

  • @LeagueRandomPlayer
    @LeagueRandomPlayer 4 ปีที่แล้ว +1

    Your videos are great your explanation is great, just because im almost blind please put your code bigger, please! still liked the video

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      haha, I will see if I can make it a little bit bigger, thank you for the feedback 😊

  • @mhmdibrahim6598
    @mhmdibrahim6598 4 ปีที่แล้ว

    thanks...can you make an app using getx & firebase

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      I actually made a todo app with getx & firebase th-cam.com/play/PL26uY6-lIzqm-P1_Hi072D9FzwltjhAGG.html

  • @lamonteplays
    @lamonteplays 4 ปีที่แล้ว +1

    You should give Momentum a try next

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      I haven't even heard of that one. There are so many haha. But Momentum has some nice documentation!

    • @lamonteplays
      @lamonteplays 4 ปีที่แล้ว +1

      @@tadaspetra yeah momentum is pretty cool. it's by one guy and I accidentally found it by chance on reddit and I'm surprised not more are talking about it. There's so many though, I tend to stick to the ones w/ solid documentation. I haven't stuck to one just yet, I'm sure we'll see even more in the coming months as things are picking up in the flutter world.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      G4MR Plays I hope they stop lol. I feel like it’s best to just pick one and go with it. I’ll probably be sticking with Riverpod and GetX depending on the app 😊

    • @lamonteplays
      @lamonteplays 4 ปีที่แล้ว +1

      @@tadaspetra lol yeah same, I'm going to dabble with Riverpod, but probably stick with Momentum from now.

  • @void4904
    @void4904 4 ปีที่แล้ว +1

    It's not easier than I thought 😅

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      It is a bit more complex, but I think if you get comfortable with it, it's a lot more powerful

    • @void4904
      @void4904 3 ปีที่แล้ว

      @@tadaspetra in this time. i'm enjoying with Riverpod. Thanks for your insight :)

  • @saadmansoor3547
    @saadmansoor3547 2 ปีที่แล้ว

    udpate the video bro

  • @mitzukodavis7393
    @mitzukodavis7393 4 ปีที่แล้ว +1

    The best?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Mitzuko Davis no no. No such thing as the best for any solution. But in my opinion, better then provider

  • @ankitrathore3946
    @ankitrathore3946 4 ปีที่แล้ว

    The thing you are calling ref .. it is context .. renaming it doesn't mean sense.. if you cant access it outside of build method.. then you can't say that .. it is not depend on context .. but you can say that it hi des the complexities of provider..

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      It is named "ref" in the documentation and it is technically a ProviderReference. What you say is true, but I don't think there's any problem with naming it ref

  • @jrheisler
    @jrheisler 4 ปีที่แล้ว +1

    Easy peasy, but not Getx easy lol

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +3

      j heisler yes exactly. But there are some benefits, it is more safe and all cases need to be covered or you will get an error