Member-only story
Provider Is Not State
All sorts of frameworks listed on the Flutter State Solutions page. But, most of them are DI frameworks and not state management. Provider is just a DI framework just like GetIt, Getx, MobX, Riverpod, and all the rest of them. Let’s emphatically find out what a state management system is in Flutter.
Background
I am going to use the Provider DI framework as an example, but it applies to all DI frameworks. Here, let’s look at the typical DI architecture using the Provider example:
The only part that is state is inducing state change and reporting state change. The management is the reporting state part of app architecture! If I do not report state change to the model, do I have state management?
Or to ask another way, if I only use ChangeNotifier in a counter model do I have state management. Maybe not fully but it’s a start as via the listener we are reporting the state somewhere.
Yes, any DI framework has a state inducement part. But, that is not state management.
The only framework that has beginning state management and DI in the same framework is Redux. And I state that as Redux by itself attempts to…