lastOrNull

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

The terminal operator that returns the last element emitted by the flow or null if the flow was empty.