provider
provider copied to clipboard
Restoration Framework
Are there any plans to implement this for providers? https://docs.google.com/document/d/1KIiq5CdqnSXxQXbZIDy2Ukc-JHFyLak1JR8e2cm3eO4/edit#
What are you expecting from provider here?
provider is for business state, which is in the "domain state" category. Domain state if out of the scope of the restoration API
For example, I have a search provider. I do not need to store this data between application launches, but I would like the state to persist if the system kills the Activity.
Therefore, it would be convenient if the provider provided an API so that my provider class could save its state
The issue is broader than what Provider can or cannot do, and could be restated as follows:
Any framework or library (like Provider or Flutter 2 Navigator) enabling the app to use StatelessWidget+ChangeNotifier pattern, thus making StatefulWidget largely unnecessary, leads to RestorationMixin - which seems to be the cornerstone of the state restoration - being useless due to its dependency on the StatefulWidget.
To solve this problem, an example of how to implement app state restoration for the app that uses stateless widgets and gets its state from change notifiers, would be supremely helpful.