getList<T> static method
获取普通的List
Implementation
static Future<List<T>> getList<T>(String key, {List<T>? defValue}) async {
if (_prefs == null) await getInstance();
List<String> dataList =
(_prefs?.getStringList(key) ?? defValue ?? []) as List<String>;
return dataList.map((value) {
T dataMap = json.decode(value) as T;
return dataMap;
}).toList();
}