KwikCountDownTimer

fun KwikCountDownTimer(timeMillis: Long, onTimeUpdate: (String) -> Unit, onTimerFinished: () -> Unit)

A countdown timer that displays the time remaining in the format "mm:ss".

Parameters

timeMillis

The total time in milliseconds to count down from.

onTimeUpdate

The callback that will be called every second with the current time remaining.

onTimerFinished

The callback that will be called when the timer reaches 0.

You can use it to display a countdown timer in your Composable. For example, you can use it to display a countdown timer in a quiz app. Or to wait for an OTP to be sent before allowing the user to resend it.

Example usage:

KwikCountDownTimer(
timeMillis = 60000L,
onTimeUpdate = { time ->
Text(time)
},
onTimerFinished = {
Text("Timer finished")
}
)

fun KwikCountDownTimer(minutes: Int, seconds: Int, onTimeUpdate: (String) -> Unit, onTimerFinished: () -> Unit)