withIndex

fun <T> Flow<T>.withIndex(): Flow<IndexedValue<T>>

Returns a flow that wraps each element into IndexedValue, containing value and its index (starting from zero).

Sources

common source
Link copied to clipboard