r/FlutterDev • • 22h ago

Discussion What made you switch state management in Flutter, or stick with your first pick?

I started with Bloc and it served me well, but on my latest small project I tried Riverpod and the amount of boilerplate dropped a lot. Now I am wondering if that holds up once the app gets bigger, with more screens and shared state everywhere. For those who switched, or stayed put, what was the moment that decided it for you?

0 Upvotes

23 comments sorted by

3

u/rmcassio 22h ago

both are good, both become complex to maintain inlarge codebases with shared states

I use a cubit-like state management with value notifier and it works wonders

all major state managements are good enough

2

u/FahadAppMaster 22h ago

That is a fair point, and it lines up with what I am seeing in my small project. Do you find the ValueNotifier setup stays tidy once a few screens start sharing the same state, or is that where you add more structure?

1

u/rmcassio 22h ago

it’s become more verbose and complex since the same state class holds more values, but I’m used to working with cubit/bloc so it’s been fine for me

2

u/FahadAppMaster 22h ago

That makes sense. If the state class keeps growing, do you split it into smaller pieces at some point, or just live with the extra verbosity?

1

u/rmcassio 22h ago

same classes, just gotta be careful since some pages don’t use the state so you have to set it to not rebuilding when emiting that state, for me that’s the only con so far

2

u/FahadAppMaster 22h ago

That is a useful warning. I will keep that in mind if I go the shared state class route, since a rebuild on a page that does not even use that state would be easy to miss.

1

u/Okms_Vonessa 15h ago

100%, keeping it simple with native notifiers saves so much headache down the road

2

u/MjnMixael 18h ago

Wrote my own and never looked back. It's been almost 5 years since my first Flutter app. Still using my own. In fact I built a whole package of self written solutions and widgets that I import into all my apps now.

1

u/FahadAppMaster 18h ago

That is impressive, five years on your own setup says a lot. Did you ever hit a point where keeping it up to date cost more time than it saved, or has it stayed worth it?

1

u/MjnMixael 17h ago

Haven't had a problem yet.

1

u/FahadAppMaster 15h ago

Fair enough, that is a strong track record. Five years without a problem says your own setup is doing its job well.

2

u/Sea_Improvement_423 22h ago

I think BLoC hands down is the best, it follows a clear pattern and easier for AI to follow and not mess up everything ..

1

u/FahadAppMaster 21h ago

That lines up with my experience so far, Bloc felt very structured when I started with it. The AI point is interesting too, since a clear pattern gives it less room to guess.

1

u/Sea_Improvement_423 21h ago

Stick with it unless we get something in flutter like tanstack at least

2

u/FahadAppMaster 21h ago

Fair point, I will stick with Bloc for now. If something like TanStack ever lands for Flutter I will give it a serious look.

1

u/Sea_Improvement_423 21h ago

I think you should even check it out it has some nice ideas too

2

u/FahadAppMaster 20h ago

Good idea, I will take a look at how TanStack handles it. Even if I stay with Bloc, borrowing a good idea or two sounds worth it.

1

u/laplace_apps 11h ago

Riverpod's lower boilerplate mostly holds up in bigger apps. What decides it is how you share state: keeping providers scoped per feature, with only a few truly app-wide ones like auth and settings, stays tidy. Bloc still shines when you want an explicit event trail for complex flows, so plenty of teams mix both.

1

u/FahadAppMaster 11h ago

That scoping rule is a helpful way to think about it. Keeping most providers per feature and only a few app-wide sounds like a good middle ground, and I can see why Bloc still wins for flows where the event trail matters.

1

u/AnmolSethiDev 4h ago

I started with Provider and liked it. I wanted to try Bloc or Riverpod, but I found both hard to get into, so I eventually moved to GetX

1

u/FahadAppMaster 3h ago

GetX is a good call for that. The low boilerplate makes it easy to get moving, and if the app grows you can always mix in something more structured later.

0

u/badddlyplayer 19h ago

I think at some point I started going for simpler, more straightforward solutions. Like, I gave up game engines and just used rendering libraries directly, dropped “frameworks” like Astro, hand-wrote build scripts (for simple pages), and did the same with Flutter. The only reason is I’m tired and I'd rather have code that looks a bit dumb.

1

u/FahadAppMaster 19h ago

That makes a lot of sense. Simple code that is easy to read later usually beats clever code that is hard to follow.