single

suspend fun <T> Flow<T>.single(): T(source)

The terminal operator that awaits for one and only one value to be emitted. Throws NoSuchElementException for empty flow and IllegalArgumentException for flow that contains more than one element.