Understanding State Management in Flutter - Foundation

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

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

  • @goddardpk
    @goddardpk 3 ปีที่แล้ว +7

    Max, thanks for the high level introduction to state management and the clean use of diagrams to support your descriptions!

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

      You are most welcome Paul, thank you for your amazing feedback :)

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

    Thanks for the video. Now I have a clear idea to start with State management

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

    That's a top quality video. You definitely deserve a lot more views and subscribers.

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

      Thank you, I am glad that you think so :)

  • @iAnguel
    @iAnguel 2 ปีที่แล้ว +1

    Thanks for the overview. I wonder if it is possible to recommend a state management package for a specific use case like a Flutter UI with a network client underneath that sends commands to a server and then react depending on the server responses, i.e. changes the UI. From the overview looks like BLOC is a good fit, but maybe I am wrong? What would you recommend?

  • @anyiethaguekayuen5688
    @anyiethaguekayuen5688 3 ปีที่แล้ว +1

    Thanks for your explanation, it is clear enough.

  • @meylisannagurbanow3455
    @meylisannagurbanow3455 3 ปีที่แล้ว +1

    I like your videos buddy. You crushing it!

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

    Hi , I came across getx package for state management.
    What do you think about this package?

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว +1

      Hi Lovin, a lot of users of Flutter love getX and would recommend it. I personally be very careful with it. In my opinion a it is a anti pattern to have a package that tries to solve every problem. It is not only state management it is also routing, DI and more.
      It can be a great help to get something up and running, but if you search for long time solutions in a larger project I would not recommend it because the maintenance price tag could become quite large.

  • @PaulMsegeya
    @PaulMsegeya 3 ปีที่แล้ว +1

    Awesome content, keep up the good work.

  • @Darthilandia
    @Darthilandia 3 ปีที่แล้ว +1

    Nice video mate!

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

      Thank you, I am glad that it helped you :)

  • @mgbhadurudeen336
    @mgbhadurudeen336 2 ปีที่แล้ว +1

    it would have been better, if you have shown any code. anyhow good video, thank you.

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

      There are multiple follow up videos for different state management libs like setState / provider and redux :) feel free to check them out.

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

    In the context of State Management of Flutter, Can we say like State Class used to return the state object that contains Stateful Widget? [Especially when the createState() method called.]

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Uf, that is a tough one. I gutess you could say that. The only problem is that there is more than just a Stateful Widget that could contain state, also Services that are used inside of your widgets could contain state. But as a general rule of thumb I guess this is pretty accurate!

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

    Does stateless is like functional component in react?

  • @ivanyoed
    @ivanyoed 3 ปีที่แล้ว +1

    I kept waiting for GetX. Besides, this state management package is more used and famous than all the others mentioned, except for Provider. Hopefully you'll talk about it later. Anyways. Thank you for making this video and again, nice Job! Sharing this vid.

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Hi thanks for letting me know, I have getX on my todos, but I am a bit negativly biased and want to try to get more information and maybe talk with some experts before I announce my oppinion to it :). I am happy that you liked the session so far.

    • @ivanyoed
      @ivanyoed 3 ปีที่แล้ว +1

      @@FlutterExplained Thanks! It seems to me that you are proceeding professionally, and I like that. Hoping to watch that video! And again, keep it up!

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

    Very good video, thank you!

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

      You are very welcome, I am glad that you enjoyed it!

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

    I really loved the video. Is it possible to use redux in combination with bloc? and is it a good idea to do it?

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

      Thanks for your feedback :). Is it possible, I am pretty sure, and there is already a package that does exactly this. There is even a package that tries to achieve exactly that. pub.dev/packages/bloc_redux
      But I am not sure if it is a good idea, behind each package there are a big fanbase and community, and most likely there is a reason why they decided for one pattern or the other. Another way would be to work with RxDart and create your own "bloc" pattern like, for example, GroovinChip and Luke Pighetti explained in their interviews.

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w 3 ปีที่แล้ว

    Is it like global variables in a way?

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

      Great question! Not really, a global variable could contain state as for example Riverpod does. But Not all global variables are state. It is the state you want the program to be in if the global variable contains the background color, then yes it is your state of the background color. If you use the global variable only to contain information that you need for a calculation then no it is not really the state. I hope that helps.

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

    What about Provider? Is it good enough?

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

      Yes of course in 8:44 I talked about it. It is great in most cases and in smaller apps. You could only run into long-term issues with boilerplating and other packages have additional features that help but the trade off is higher. I hope that helps.

  • @dipakbari4
    @dipakbari4 3 ปีที่แล้ว +1

    12:10 Best State Management solution is here. :-)

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Wow this video is recorded on the 2. June :O how much has changed since then is absolutly incredible.

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

      @@FlutterExplained 😀. Whenever I get doubts I usually look for "MyFlutterDoubts flutter explained" 😂🤣

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

    What are examples of too much boiler plate code with the provider package? It seems to have the least amount.

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

      Hi Toasticuss, for me, it started the first time I required three different ChangeNotifier at one point and, I needed to wrap three Consumers around each other. That lead to a tremendous sized widget. It could be that it was just wrongly used, but other packages helped me there a lot. I think that Provider is a right choice and will work, but in large-scale projects, I would not rely solely on it. Maybe more boilerplate was wrongly chosen, and it should be more confusing or bloated widget tree.

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

      @@FlutterExplained You can use MultiProvider in order to make the code look cleaner. pub.dev/documentation/provider/latest/provider/MultiProvider-class.html

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

      But this helps only with the registration not with the consumer right?

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

      @@FlutterExplained I think it depends on the situation. I'm trying to learn Flutter myself at the moment, so unfortunately I don't know if I do this right but I wrap each widget separately with Consumer if it needs to be notified about changes.

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

      @@mivoligo That sounds right :) the problem is just that if you have a widget that needs multiple consumers, then the widget tree gets bit messy but I will show in my video what I mean :). Thanks for sharing your conserns.

  • @zstrizzel
    @zstrizzel ปีที่แล้ว

    GetX?

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

    I'm learning state management for the first time at moment. I loved the video as an overview of the current solutions. I can't wait for the provider video. I think it's the best one to start with for beginners.
    Note: maybe it's my phone speaker, but the audio can be improved. It's slightly not enjoyable to listen to.

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

      Thanks for the note I will check and look if I can improve it for the next time :)

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

    SUBED

  • @alokkumarmaurya2231
    @alokkumarmaurya2231 ปีที่แล้ว

    👍👍

  • @farseenabdulsalam6246
    @farseenabdulsalam6246 3 ปีที่แล้ว +1

    1. Explanation of individual methods were very shallow.
    2. Introduction wasnt concise. Over explained introduction.
    Very low signal to noise ratio.