【发布时间】:2021-08-24 10:39:39
【问题描述】:
我正在尝试使用 Flutter 的共享首选项插件将字符串列表保存在列表中。
[
["str1", "str2"],
["str3", "str4"]
]
【问题讨论】:
-
欢迎来到 SO - 请描述您的问题...
我正在尝试使用 Flutter 的共享首选项插件将字符串列表保存在列表中。
[
["str1", "str2"],
["str3", "str4"]
]
【问题讨论】:
试试这个:
const temp = json.encode({'data':[
["str1", "str2"],
["str3", "str4"]
]});
然后将temp 保存在您的共享首选项中。从您的 sharedPref 获取此字符串后,不要忘记使用 json.decode。
【讨论】: