singleOrNull

suspend fun <T> Flow<T>.singleOrNull(): T?(source)

The terminal operator that awaits for one and only one value to be emitted. Returns the single value or null, if the flow was empty or emitted more than one value.