getListCustom<T> static method

Future<List<T>> getListCustom<T>(
  1. String key,
  2. T f(
    1. T v
    ), {
  3. List<T>? defValue,
})

获取自定义的List类型的数据 第二参数Fn自定义转换结果,并返回类型

Implementation

static Future<List<T>> getListCustom<T>(String key, T Function(T v) f,
    {List<T>? defValue}) async {
  if (_prefs == null) await getInstance();
  List<T> list = await getList<T>(key, defValue: defValue);
  list = list.map((value) => f(value)).toList();
  return list;
}