mapIndexedNotNull<R> method
Returns a list containing only the non-null results of applying the given transform
function
to each element and its index in the original collection.
@param transform
function that takes the index of an element and the element itself
and returns the result of the transform applied to the element.
Implementation
KtList<R> mapIndexedNotNull<R>(R? Function(int index, T?) transform) {
final mapped = mapIndexedNotNullTo(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;
}