customMap<T> method

List<T> customMap<T>(
  1. T? toResult(
    1. E e
    )
)

Implementation

List<T> customMap<T>(T? toResult(E e)) {
  List<T> newList = <T>[];

  this?.forEach((element) {
    T? result = toResult(element);
    if (result != null) {
      newList.add(result);
    }
  });

  return newList;
}