Riverpod State Management

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

КОМЕНТАРІ • 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 😊

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

      My pleasure 😊 glad I could help

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

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

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

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

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

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

    Guy, you are the best.

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

      Thank you!! I am planning another Riverpod video soon

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

    Amazing explanation!

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

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

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

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

    Thanks, good video.

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

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

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

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

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

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

    Can we create stateProvider of String?

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

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

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

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

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

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

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

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

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

    Which VS Code theme you use?

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

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

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

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

    I saw your testing videos bro

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

  • @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 ua-cam.com/play/PL26uY6-lIzqm-P1_Hi072D9FzwltjhAGG.html

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

    0:00 Your last what?

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

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

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

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

    udpate the video bro

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

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

      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