Reputation: 61
I'm trying to use flutter's shared preferences plugin to save a lists of strings inside a list.
[
["str1", "str2"],
["str3", "str4"]
]
Upvotes: 0
Views: 195
Reputation: 2171
try this:
const temp = json.encode({'data':[
["str1", "str2"],
["str3", "str4"]
]});
then save temp
in your sharedpref. Do not to forget to use json.decode
after getting this string from your sharedPref.
Upvotes: 2