Using AysncStorage to Store Data in React Native

preview_player
Показать описание
This video demonstrates how to use the AsyncStorage package to store data offline in key-value pairs. This is a great way to store things like app settings/preferences. We will create a mock settings screen that saves and restores various app settings.

00:26 Discussing the settings screen without AsyncStorage and looking at docs
05:52 Creating functions to store data using AsyncStorage
09:44 Creating a function to restore defaults values in AsyncStorage
11:35 Storing theme color state in the React Navigation navigation state
13:00 Highlighting components with colors based on the selected theme color
15:40 Saving AsyncStorage by with JSON.stringify
17:26 Creating a function to get AsyncStorage values using 'getItem'
21:23 Changing the appbar/header color based on an AysncStorage value
27:22 Changing the Switch color based on an AysncStorage value
28:38 Changing the Slider color based on an AysncStorage value
30:00 Testing

Рекомендации по теме
Комментарии
Автор


Note that your import in the app will also be different. It should now be:

TheFlutterFactory
Автор

Are there any other data storage solutions you would like to see a covered? Leave a comment below

TheFlutterFactory
Автор

I want to export the selected color to the another file so that i can also change the colors of that screen too. But when i export it to another file by async storage it gives me a promise object of color. I just want the name of the selected color in the other files too. How can I do it?

umershakeel
Автор

irrelevant but do you have any idea how i can multiple locations while navigating from one location to another

ShalonMachado
Автор

When the new flutter video come? I am waiting bro!

HimanshuYT