mapNotNull<R> method

KtList<R> mapNotNull<R>(
  1. R? transform(
    1. T?
    )
)

Returns a list containing the results of applying the given transform function to each element in the original collection.

Implementation

KtList<R> mapNotNull<R>(R? Function(T?) transform) {
  final mapped = mapNotNullTo(mutableListOf<R>(), transform);
  // TODO ping dort-lang/sdk team to check type bug
  // When in single line: type "DartMutableList<String>' is not a subtype of type 'Null"
  return mapped;
}