populate static method

dynamic populate(
  1. List? target,
  2. String? listType,
  3. List from,
  4. TypeContext? context,
)

Implementation

static populate(List? target, String? listType, List from, TypeContext? context) {
  var elementType = getElementType(listType);
  List list = from;
  list.forEach((x) {
    var item = convert(x, elementType, context);
    target!.add(item);
  });
  return target;
}