简体   繁体   中英

How to store List<Object> in Flutter using sharedPreferences?

I want to save list of PlatformFile, with the help of file_picker library and store them using sharedpreferences and then load them back. list -> List

I think you can. You can convert that list of PlatformFile into json string and store that string ti shared preferences. It's the best way to store it.Otherwise you need to store them in local db. And when you read just convert that string to list of PlatformFiles again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM