mirror of
https://github.com/asjqkkkk/flutter-todos.git
synced 2025-08-13 22:06:52 +08:00
完成了颜色选择,新增icon,以及icon数量限制
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user