完成了颜色选择,新增icon,以及icon数量限制

This commit is contained in:
oldchen
2019-07-13 13:34:58 +08:00
parent bc454181a6
commit 7c7bf94388
11 changed files with 427 additions and 41 deletions

View File

@ -48,12 +48,14 @@ class SharedUtil{
}
void readAndSaveList(String key, String data) async{
Future<bool> readAndSaveList(String key, String data) async{
SharedPreferences prefs = await SharedPreferences.getInstance();
String account = prefs.getString(Keys.account) ?? "default";
List<String> strings = prefs.getStringList(key + account) ?? [];
if(strings.length >= 10) return false;
strings.add(data);
await prefs.setStringList(key + account, strings);
return true;
}