getNestedList<T> function

List getNestedList<T>({
  1. required int depth,
  2. required List<T> valueList,
})

Get a List

Specify depth to added one or more parent Lists.

Example: depth 0 = List

Implementation

List getNestedList<T>({
  required int depth,
  required List<T> valueList,
}) {
  if (depth == 0) {
    return valueList;
  }

  return getNestedList(depth: depth - 1, valueList: _addParent(valueList));
}