DEV Community

Cover image for Most popular Flutter state management libraries in 2022
Martin Jablečník
Martin Jablečník

Posted on • Updated on

Most popular Flutter state management libraries in 2022

Edit: After one year I released new updated article here:



Flutter is only toolkit which focus mainly into how to show your Statefull or Stateless widgets but doesn't solve a lot of problems with state management or architecture design of your application like some other frameworks.

You are very free in how you will manage states and community around Flutter bring a lot of solutions how to do it.

But many new developers can be confused too large choose of different packages solving state management problems so I decided to make this overview of the most popular Flutter state management packages with small description about them.

I hope that you gain good overview about all packages which exists and will be helpful for choose right solution for you.


Bloc

Bloc is probably the most popular state management solution which learn you also architectural pattern: Presentation, Bussiness Logic, Data (Repository, Provider)

Pros:

  • Easy for separate presentation from business logic
  • Great documentation with many examples
  • Dependency injection: Uses Provider internally to make it easy provide and access blocs throughout the widget tree.
  • Can persist and restore states
  • Support for undo and redo states
  • Widely used by Flutter community
  • Active development with many sponsors

Cons:

  • Maybe hard to understand for new developers
  • Too many boilerplate code

Popularity:
GitHub: 8282 stars
Pub.dev: 1400 likes

Links:
Official Page: https://bloclibrary.dev
Documentation: https://bloclibrary.dev/#/gettingstarted
Github: https://github.com/felangel/bloc

Development activity:
Development activity


GetX

GetX is second most popular state management solution and very fast growing in popularity. Is also the most controversional and evoking conflicts in Flutter developer community because many developers hate this package due to antipatterns, bad testability or documentation, but many developers also love it due to simplicity and very short code which you write so then you feel more productive.

I found some interesting opinions about this package in Reddit so you can make your own opinion: Opinion 1, Opinion 2, Opinion 3

And here is discussion between author of GetX and authors of other state management solutions (Bloc and Provider) which probably cause many hates in Flutter community against GetX:
https://github.com/jonataslaw/getx/issues/243

Pros:

  • Very simple for new Flutter developers
  • Very short code
  • Big popularity
  • Solving also dependency injection

Cons:

  • Package is solving too many things => Vendor lock into only one big package
  • Without any sponsors => When author stop support of this package so you can rewrite whole your app from scratch
  • Too big package which have too many issues
  • Development isn't very active
  • When you find some issue you can wait too very long time for fix
  • Bad reputation in Flutter community
  • Documentation is not actual

Popularity:
GitHub: 5687 stars
Pub.dev: 7479 likes

Links:
Official page: Only GitHub and Pub.dev
Documentation: Only Github README
Github: https://github.com/jonataslaw/getx

Development activity:

Development activity


States_Rebuilder

States_Rebuilder is Flutter state management combined with a dependency injection solution and integrated router.
I didn't tried a lot this package but when I see into documentation so I feel that author want to do too much things in one package (similar like GetX) instead of focus only into state management solution..

Package solve also:
internationalization, form validation, authentication, server queries, etc..

Pros:

  • Separate presentation from business logic
  • Can persist and restore states
  • Support for undo and redo states
  • Built-in dependency injection system
  • Development is active

Cons:

  • Is doing too much things (not only state management)
  • Only one maintainer without sponsors
  • Not so popular (Isn't widely used)

Popularity:
GitHub: 442 stars
Pub.dev: 332 likes

Links:
Official page: Only GitHub and Pub.dev
Documentation: https://github.com/GIfatahTH/states_rebuilder/tree/master/states_rebuilder_package#readme
Github: https://github.com/GIfatahTH/states_rebuilder

Development activity:
Development activity


Provider

Provider is a wrapper around InheritedWidget for make it easier and simple use. This package is good for anybody who want to manage data with InheritedWidget but in more simple way.
Provider is also used internally in Bloc package for provide and access bloc objects in widget tree and can be used also with: Triple, ValueNotifier, ChangeNotifier or other state objects.

Pros:

  • Make InheritedWidget more simple
  • Widely used and popular
  • Supported by Flutter team

Cons:

  • Some problems which are solved in Riverpod

Popularity:
GitHub: 4007 stars
Pub.dev: 5734 likes

Links:
Official page: Only GitHub and Pub.dev
Documentation: Only Github README
Github: https://github.com/rrousselGit/provider

Development activity:
Development activity


Riverpod

Riverpod is from same author as Provider and it is a reimplementation of InheritedWidgets from scratch because during development of Provider author was faced with some problems which removed in Riverpod.

Pros:

  • Simple
  • Similar to Provider

Cons:

Popularity:
GitHub: 2289 stars
Pub.dev: 1282 likes

Links:
Official page: https://riverpod.dev
Documentation: https://riverpod.dev/docs/getting_started
Github: https://github.com/rrousselGit/river_pod

Development activity:
Development activity


Modular + Triple

Modular and Triple are 2 different packages but work great with together.
These packages (and many others) are developed by Flutterando Community which is huge Flutter community from Brasil.
Triple is simple package for manage your state by Segmented State Pattern and Modular provide DI and Routing with modular project structure.

Pros:

  • Very simple development without boilerplate code
  • Developed by community of developers
  • Separate presentation from business logic
  • Can persist and restore states
  • Support for undo and redo states
  • Very nice dependency injection with Modular
  • Very nice documentation
  • Triple is one simple package so you can use it also without Modular

Cons:

  • Triple is only one year old so it isn't known yet a lot.

Popularity of Modular:
GitHub: 1015 stars
Pub.dev: 789 likes

Popularity of Triple:
GitHub: 87 stars
Pub.dev: 63 likes

Links for Modular:
Official page: https://modular.flutterando.com.br
Documentation: https://modular.flutterando.com.br/docs/intro
Github: https://github.com/Flutterando/modular

Links for Triple:
Official page: https://triple.flutterando.com.br
Documentation: https://triple.flutterando.com.br/docs/intro
Github: https://github.com/Flutterando/triple_pattern

Development activity for Modular:
Development activity for Modular

Development activity for Triple:
Development activity for Triple


GoRouter + GetIt + Triple

If you don't like Modular or you don't want to be dependent on library which is doing 2 different things. So this is good alternative combination I think.
Triple you know from previous point and GoRouter with GetIt are doing almost same things like Modular.
This combination is good if you don't want to be depending only on one big package maintained by only one developer (like GetX or States_Rebuilder).
But you have 3 different nice things developed from different developers and anyone from these packages can be changed anytime with some alternative.

Pros:

  • Very simple development without boilerplate code
  • Developed by more different developers
  • Separate presentation from business logic
  • Can persist and restore states
  • Support for undo and redo states
  • GoRouter and GetIt make same nice things like Modular
  • GetIt is quite popular alternative for Provider

Cons:

  • Triple and GoRouter are only one year old so they aren't known yet a lot.

Popularity of GoRouter:
GitHub: 274 stars
Pub.dev: 442 likes

Popularity of GetIt:
GitHub: 833 stars
Pub.dev: 1742 likes

Links for GoRouter:
Official page: https://gorouter.dev
Documentation: https://gorouter.dev/getting-started
Github: https://github.com/csells/go_router

Links for GetIt:
Official page: Only GitHub and Pub.dev
Documentation: Only GitHub README
Github: https://github.com/fluttercommunity/get_it

Development activity for GoRouter:
Development activity for GoRouter

Development activity for GetIt:
Development activity GetIt


Cube

If you are fan of GetX so probably you will like also this package because it is very similar to GetX state management. I am very curious if author of Cube will also want to create some big framework similar as author of GetX or not. :-)
Cubes doesn't rely on RxDart but use of ChangeNotifier because it is a feature already available in Flutter.

Pros:

Cons:

  • Young project (It is not known yet)

Popularity:
GitHub: 12 stars
Pub.dev: 19 likes

Links:
Official page: Only GitHub and Pub.dev
Documentation: Only Github README
Github: https://github.com/RafaelBarbosatec/cube
Pub.dev: https://pub.dev/packages/cubes

Development activity:
Development activity


Meedu

Meedu is very interesting young project. In one package solves: State Management which is very similar to Riverpod, Dependency Injection which is very similar to DI from GetX and contains also Reactive programming which is very similar like State management in GetX.
So if you like Riverpod and GetX DI this package is right for you ;-)

Pros:

  • Simple as Riverpod
  • Simple DI like in GetX

Cons:

  • Very young project
  • Router module doesn't support Navigator 2.0

Popularity:
GitHub: 17 stars
Pub.dev: 61 likes

Links:
Official page: https://flutter.meedu.app
Documentation: https://flutter.meedu.app/docs/5.x.x/intro
Github: https://github.com/darwin-morocho/flutter-meedu

Development activity:
Development activity


MobX

MobX is a state-management library that makes it simple to connect the reactive data of your application with the UI. This wiring is completely automatic and feels very natural. As the application-developer, you focus purely on what reactive-data needs to be consumed in the UI without worrying about keeping the two in sync.

Pros:

  • Very simple
  • Nice for begginers
  • Have some sponzors
  • Without boilerplate code

Cons:

  • You have to rebuild code after every change
  • Developer activity looks very poor

Popularity:
GitHub: 2051 stars
Pub.dev: 758 likes

Links:
Official page: https://mobx.netlify.app
Documentation: https://mobx.netlify.app/getting-started
Github: https://github.com/mobxjs/mobx.dart

Development activity:
Development activity


Redux

Probably good choice for somebody who know Redux from React world. But this version for Dart seems that is not very popular, doesn't any good documentation and development is also very low. (Last update was 10 months ago)

Pros:

  • Maybe good for somebody who already know Redux

Cons:

  • I didn't found any good documentation
  • Low development
  • Not very used in Flutter community
  • Last commit is old for 10 months

Popularity:
GitHub: 1527 stars
Pub.dev: 330 likes

Links:
Official page: Only GitHub and Pub.dev
Documentation: Only Github README
Github: https://github.com/brianegan/flutter_redux

Development activity:
Development activity


Packages which you can find but development is in too early stage:

Packages which you can find but development is not so active:


Conclusion

I tried many various solutions and I had some bad or very bad experiences with some solutions.

Here are some my personal short opinions about every solutions which I described here. You can agree with me or not:

Bloc Quite good, but for somebody it can be too complex or too boilerplate code
GetX For somebody it can be too controversional and too many bugs in one package with incomplete docs
Provider I am not sure if use Provider or Riverpod
RiverPod I am not sure if this is really ready for production
States_Rebuilder Too much things in one package like GetX
Modular + Triple Very nice solution and I didn't find any problems yet after half year of usage
GoRouter + GetIt + Triple Very nice alternative for previous solution, but I didn't tried it yet
MobX Very nice solution but package is finding maintainer and I am not sure about future of this project
Redux I feel that this package is already abandoned
Cube Package is in too early stage and I am not sure if development will be also active in the future
Meedu Package is in too early stage and I am not sure if development will be also active in the future
Bolter Package is in too early stage

Thank you very much for read this my long overview and if this article is useful for you, let me know it by give a like or some comments below. ;-)

Top comments (1)

Collapse
 
helencardona14 profile image
Helen cardona

right now learning about businesses, companies and how each of them is managed is important for people who are starting their businesses right now the company registration with pages like osome.com/sg/incorporation/ It is one of the best ways to create a brand and above all a reputation that is growing or will grow much faster.