toList<T> static method

List<T>? toList<T>(
  1. List? mapList,
  2. T? creator(
    1. Map? map
    )
)

Implementation

static List<T>? toList<T>(List? mapList, T? Function(Map? map) creator) {
  if (mapList == null) {
    return null;
  }
  List<T> ret = [];
  for (var m in mapList) {
    if (m == null) continue;
    var t = creator(m);
    if (t != null) {
      ret.add(t);
    }
  }
  return ret;
}