map<R> method

  1. @useResult
KtList<R> map<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

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