How to persist a List using shared preferences in flutter?

Posted by Andre Scott | Updated on

Want to persist a List using shared preferences in flutter? First, you need to convert your list of integers to a List of Strings, then you save it in shared preferences. You do the opposite when loading.

This is a complete example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers