dismissEvents

fun Snackbar.dismissEvents(): Flow<Int>

Create a Flow of dismiss events on the Snackbar instance where the value emitted can be one of the DISMISS_EVENT_* events from com.google.android.material.snackbar.Snackbar.Callback.

Note: Created flow keeps a strong reference to the Snackbar instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

snackbar.dismissEvents()
.onEach { event ->
// handle dismiss event
}
.launchIn(uiScope)