last

suspend fun <T> Flow<T>.last(): T

The terminal operator that returns the last element emitted by the flow.

Throws NoSuchElementException if the flow was empty.

Sources

common source
Link copied to clipboard