如何< String >在SQLite flutter中存储List?

9rnv2umw  于 2023-02-23  发布在  SQLite
关注(0)|答案(1)|浏览(157)

在模型中想知道有列表我想知道如何插入数据和检索数据。

7uzetpgm

7uzetpgm1#

简单解决方案:

List<String> someListOfString = ["str1", "str2"];
const composeStr = someListOfString.join("&"); // I suggest you use separator which is not used in string
// Now you can save this string to SQLite

检索时:

List<String> originalList = composeStr.split("&");

相关问题