getObjList<T> static method

List<T>? getObjList<T>(
  1. String key,
  2. T f(
    1. Map v
    ), {
  3. List<T>? defValue = const [],
})

get obj list.

Implementation

static List<T>? getObjList<T>(String key, T f(Map v),
    {List<T>? defValue = const []}) {
  List<Map>? dataList = getObjectList(key);
  List<T>? list = dataList?.map((value) {
    return f(value);
  }).toList();
  return list ?? defValue;
}