provider icon indicating copy to clipboard operation
provider copied to clipboard

Restoration Framework

Open nikitadol opened this issue 4 years ago • 3 comments

Are there any plans to implement this for providers? https://docs.google.com/document/d/1KIiq5CdqnSXxQXbZIDy2Ukc-JHFyLak1JR8e2cm3eO4/edit#

nikitadol avatar Oct 30 '20 12:10 nikitadol

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

rrousselGit avatar Oct 30 '20 15:10 rrousselGit

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

nikitadol avatar Nov 01 '20 09:11 nikitadol

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.

vgribok avatar Aug 09 '21 01:08 vgribok