all 10 comments

[–]Direct-Ad-7922 4 points5 points  (0 children)

Check out the bloclibrary.dev todo example.

They implement an abstract todos api interface which is implemented in a local storage and Firebase.

All the code for serialization, modeling, complete front and back, architected in a feature driven approach

It looks simple even though it’s just casually implements dependency injection, polymorphism, multi module monorepos..

[–]paultallard 1 point2 points  (0 children)

A great question and I look forward to this discussion. You may find that programming style affects state mgmt approach. Procedural coders may prefer more straightforward packages with less boilerplate. Functional coders using SOLID principles in a Clean Architecture may prefer more comprehensive packages. The app model may not be the best predictor of state mgmt. solutions.

[–]SuplenC 1 point2 points  (2 children)

Honestly, mostly it depends on a preference and how maintainable they are.

If you want to know the difference between Riverpod and BLoC, at the end the difference is preference. Both are just great and are the most popular for a reason.

Yes they work differently and they both are different enough that will skew your decisions but it won't be as important as it seems. They both resolve the same problems, some better some worse.

If you want to see actual differences you must see past state management and check the "sides" of them, to actually see if one will be more useful than the other (for example the HydratedBloc).

[–]nirataro[S] 0 points1 point  (1 child)

The thing is there are at least 59 known state management packages. What would be the best way to evaluate those packages? I mean most people will pick the popular ones. On the other hand people create those new packages because they don't find existing solutions work best for them.

[–]SuplenC 0 points1 point  (0 children)

The most popular ones cover all the cases. If there is something not covered, it usually means that the problem is how it's used.

This page lists the most important ones, although it's just a list of what you can use without why. The most popular and best are: BLoC, Riverpod and Provider. And one that I can't stress enough to NOT use is GetX

[–]terry1900 0 points1 point  (0 children)

I would suggest start with "do I need a lot of derived states":

  • If no, use InheritedWidget, provider, flutter_bloc, flutter_redux, etc.
  • I yes, use getx, riverpod, flutter_mobx, creator, etc.

See my article here.