withIndex

@ExperimentalCoroutinesApi fun <T> Flow<T>.withIndex(): Flow<IndexedValue<T>> (source)

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