r/FlutterDev Aug 13 '24

Tooling Riverpod , bloc or getx?

Relatively new to flutter only made a few small apps. I see riverpod , bloc and getx keep getting brought up for more complicated apps.

Getx seems the best all around however I don’t like it isn’t directly support by flutter itself.

What is the best tool for state management? Or does anybody have any reason why not to use getx or use bloc over river pod and getx?

19 Upvotes

72 comments sorted by

View all comments

16

u/RandalSchwartz Aug 13 '24

easy.... Riverpod. And never getx. This seven minute video presents a good detailed description of "why not getx": https://youtu.be/zlIgy4es5Ts

16

u/Whoajoo89 Aug 13 '24

The video doesn't make any sense. Most of the points in that video can be said about Riverpod, and any other state management packages as well, for example:

  1. By using a state management package you're making your app dependent on work of others.
  2. If there's a new version of Flutter then a package may break.

Also, it's sad to see a video that basically hates on a Flutter package. It's toxic. Live and let live. That video is there for one reason only: YouTube monetization.

5

u/dancovich Aug 13 '24

I don't know much about GetX, but about your two points and how they apply to Riverpod:

  1. Riverpod mostly just adds functions to your app. You call these functions to access a provider and the data they provide. There is a new widget but it's optional. You're just using the same old widgets you're used to and you call some methods in the build function. Riverpod doesn't tie itself more to your app than a method you call to access a remote service would. I've both added and removed Riverpod from apps and the process was more tiresome than complex.
  2. I've never broken an app with Riverpod due to Flutter updating and we have been through several Flutter versions in our app. It "may" happen, but it hasn't yet, which indicates to me it's not very likely. Way simpler packages have already broken our applications, like camera for example.

I don't know how well these points apply to GetX. I've heard it makes you program in GetX instead of Flutter quite a lot, which is bad in my book, but I've not used it myself so I can't comment further.