flatMap<R> method

KtList<R> flatMap<R>(
  1. KtIterable<R> transform(
    1. T
    )
)

Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.

Implementation

KtList<R> flatMap<R>(KtIterable<R> Function(T) transform) {
  final list = flatMapTo(mutableListOf<R>(), transform);
  // making a temp variable here, it helps dart to get types right ¯\_(ツ)_/¯
  // TODO ping dort-lang/sdk team to check that bug
  return list;
}