negativeButtonClicks

fun <S> MaterialDatePicker<S>.negativeButtonClicks(): Flow<Unit>

Create a Flow of negative button click events on the MaterialDatePicker instance when the user clicks the cancel button.

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

Example of usage:

datePicker.negativeButtonClicks()
.onEach {
// handle date picker negative button clicked
}
.launchIn(uiScope)

fun MaterialTimePicker.negativeButtonClicks(): Flow<Unit>

Create a Flow of negative button click events on the MaterialTimePicker instance when the user clicks the cancel button.

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

Example of usage:

timePicker.negativeButtonClicks()
.onEach {
// handle time picker negative button clicked
}
.launchIn(uiScope)