mapIndexed

fun <T, R> Flow<T>.mapIndexed(transform: suspend (index: Int, value: T) -> R): Flow<R>(source)

Returns a flow containing the results of applying the given transform function to each value and its index in the original flow.