fromJsonListT<T> method

List<T>? fromJsonListT<T>(
  1. T fromJsonT(
    1. dynamic json
    )
)

json数据转集合对象

Implementation

List<T>? fromJsonListT<T>(T Function(dynamic json) fromJsonT) {
  var str = this;
  if (str == null || str.isEmpty) {
    return null;
  }
  List list = json.decode(str);
  return list.map((value) {
    return fromJsonT(value);
  }).toList();
}