getListT<T> static method

List<T>? getListT<T>(
  1. String key,
  2. T fromJsonT(
    1. dynamic json
    )
)

获取sp中key的对象值

SpUtils.getListT("key3", (json) => A.fromJson(json));

Implementation

static List<T>? getListT<T>(String key, T Function(dynamic json) fromJsonT) {
  var str = _prefs.getString(key);
  return str.kfromJsonList(fromJsonT);
}