4.8) GetX State Management | The Complete (FREE) Flutter Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • Buy me a coffee:
    www.buymeacoff...
    Source code:
    github.com/tra...
    In this video, we continue building our Timer and learning about different state management solutions. We use GetX State Management to build our the Timer's functionality.
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Nice, hope you use GetX for all coming lectures

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

      glad you enjoyed. I want to go over bloc as well, but we'll make larger project with both in the future

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

    you can do ctrl+shift+p and search for "reload window" instead of restarting vscode manually

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

      Thank you. I honestly had no idea I could do that

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

    you can also use the getx snippets extension, then you just highlight the text you want to wrap in obx, and press alt and o.

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

      Thanks for the suggestion, I didn't know about the getx snippets. This is actually my first time using GetX.

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

      @@ovidiusmazuru9201 I'm the same Paul who recommended it to you on Facebook. You're doing really well with it. Did you say you preferred provider? Is that still the case?

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

      @@paulvickers8059 Thanks Paul. I thought you were the same, but as the last name was different I didn't want to assume anything.
      I'm not really a fan of Provider.
      From what I've seen, GetX is great.
      I like reactive state management, of which getX is one. Still, my favorite so far is BLoC. GetX is more simple which is great, but BLoC helps force a separation of ui and logic. This separation is something which is important to me. One of the dangers of Flutter is that, because we use the same language everywhere, we can easily turn our code into spaghetti code - where everything is combined in ways they shouldn't, and functions are placed where they don't belong. BLoC, at least in a small way, helps fix this. I'm sure we could do the same with GetX, but it requires a little bit of discipline whereas BLoC forces your hand a bit more.

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

      @@ovidiusmazuru9201 what is your preferred way of using bloc, like do use vanilla, or a package? I was using rxdart for a time, but didn't understand it that well and got into a little trouble, I am understanding things a little more with getx. Maybe you could show is how you use bloc in a future project, so we can get the understanding of it.

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

      @@paulvickers8059 I use flutter_bloc package. I want to show redux first, then flutter_bloc afterwards. Both flutter_bloc and getx use RxDart, without us needing to manually make it -- I don't think there's much benefit to getting our hands dirty in that way, the packages are fine.
      Reason I want to do redux first is to understand the whole event architecture. I know a lot of people don't like events, cubit even got rid of them, but I like them :))

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

    Please make the font size a little bit bigger so that watching the video over a mobile device is better to the eye.
    Thanks

  • @Quit.....529
    @Quit.....529 3 ปีที่แล้ว +1

    Hi, thanks for the tutorial. I found that GetX is much more simpler to use than Provider/RiverPod or StateRebuilder. However I am struggling to use GetX with stream function that has a parameter that can be changed. So if the par changes the stream will reset and gives the data based on the par. (for instance : streaming data from Firebase, for example a function like getMessageByUserId(userId) where userid can be changed to get the desired data stream). I know how to bind the stream to Rx variable, but the controller onInit override only initializes once , so when I pass another userid the stream function does not get called and still streaming the first userid data. Any thought or example? Thank you

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

      great question. I don't have too much experience with GetX yet as usually I use BLoC in my own apps. However, I'm planning a longer app with getx soon so I think soon I'll be able to answer you properly :))

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

    Great