putListT<T> static method

Future<bool> putListT<T>(
  1. String key,
  2. List<T>? list,
  3. Map<String, dynamic> toJsonT(
    1. T value
    )
)

存储sp中key的对象值

SpUtils.putListT("key3", list,(json) => json.toJson());

Implementation

static Future<bool> putListT<T>(String key, List<T>? list,
    Map<String, dynamic> Function(T value) toJsonT) {
  return _prefs.setString(key, list.ktoJsonT(toJsonT));
}