doTransformFromList<T> function

dynamic doTransformFromList<T>(
  1. List<T>? list,
  2. DataTransformerFrom<T>? transformerFrom,
  3. DataTransformerFromList<T>? transformerFromList
)

Implementation

dynamic doTransformFromList<T>(
    List<T>? list,
    DataTransformerFrom<T>? transformerFrom,
    DataTransformerFromList<T>? transformerFromList) {
  if (transformerFromList != null) {
    return transformerFromList(list);
  }

  if (list == null || list.isEmpty) return null;
  return list.map((e) => doTransformFrom(e, transformerFrom)).toList();
}