State management is a complex topic. It is one of the most important processes in the life cycle of an application. In Flutter State is whatever data you need in order to rebuild your UI at any moment in time. When this data change, it will trigger a redraw of the user interface.Here is a list of the most popular packages used for state management in Flutter:
1. Provider
A wrapper around InheritedWidgets to make them more reusable and easy to use. Uses a combination of ‘Provider’, ‘Consumer’, and ‘ChangeNotifier’ to expose and modify state in an efficient way.
Package : https://pub.dev/packages/provider
Official document : https://pub.dev/documentation/provider/latest/
Resource link : Provider Example
2. Riverpod
Riverpod works in a similar fashion to Provider. It offers compile safety and testing without depending on the Flutter SDK.
Package : https://pub.dev/packages/riverpod
Official document : https://pub.dev/documentation/riverpod/latest/
Resource link : Riverpod Example
3. BLoC
BloC makes it easy to implement the Business Logic Component design pattern, which separates presentation from business logic.Uses ‘Stream’s’ to manage state.
Package : https://pub.dev/packages/flutter_bloc
Official document : https://pub.dev/documentation/flutter_bloc/latest/
Resource link : BLoC Example
4. GetX
A simplified reactive state management solution.GetX is a quick, stable, and light state management library in a flutter.
Package : https://pub.dev/packages/get
Official document : https://pub.dev/documentation/get/latest/
Resource link : GetX Example
5. GetIt
A service locator-based state management approach that doesnβt need a BuildContext. It can also be used together with BloCs.
Package : https://pub.dev/packages/get_it
Official document : https://pub.dev/documentation/get_it/latest/
Resource link : GetIt Example
6. MobX
MobX is a state-management library based on observables and reactions.
Package : https://pub.dev/packages/mobx
Official document : https://pub.dev/documentation/mobx/latest/
Resource link : MobX Example
7. Redux
Redux is a unidirectional data flow architecture that makes it easy to develop, maintain and test applications.
Package : https://pub.dev/packages/flutter_redux
Official document : https://pub.dev/documentation/flutter_redux/latest/
Resource link : Redux Example
We are using Provider in our products. But we noticed that Provider has not been updated since 9 months ago so is it going to discontinue?
Do you guys think? What is an alternative suggestion instead of Provider?