Загрузка...

FLUTTER Restoration mixin | State restoration

Flutter app restoration - how to save the app state when the activity is killed by the system?
Flutter(from version 1.22) gives out of the box support for state restoration now. You can add your restorable properties which will be automatically restored when the application comes into active state after the OS kills it in the background.
Flutter have the RestorationManager, which is the class that is responsible of handling all the state restoration work, usually we don't need to use it directly. RestorationBucket which is used to hold the piece of the restoration data that our app need to restore its state later. RestorationScope, which is used to provide a scoped RestorationBucket to its descendants, if the restorationId parameter is null then, the restoration capability is disabled for its descedants. RestorationMixin this is used by our widget's state, he is the one we will usually use, it provides a straightfoward API to save and restore our state. And finally we have restorable properties (one for each Dart's data type), which are used to represent the data to be stored in the buckets.

#Flutter #RestorationMixin #RestorationManager #RestorableProperty #StatefulWidget

Видео FLUTTER Restoration mixin | State restoration канала easy FLUTTER
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять