PageStorage in Flutter - how does it work?

I saw "Storage" in the documentation. From what I understand, it is almost like an alternative to sharedpreference from the Android world.

How to use it and why do you need a widget in its implementation?

+5
source share
2 answers

PageStorage is designed to track the status of widgets that may not always be created, for example, the position of the parallel list views in a view that is viewable (for example, when you have several tabs, each with its own list). For something like sharedpreference, you should probably use sharedpreference (via the plugin). See also https://github.com/flutter/flutter/issues/4757 or https://github.com/flutter/flutter/issues/3427 .

+2
source

I'm not sure what the PageStorage class is for, but based on your notes, it looks like you're looking for a store of key values.

There is an error in the file related to providing a good plugin for such: https://github.com/flutter/flutter/issues/4757

0
source

Source: https://habr.com/ru/post/1264628/


All Articles