I am new to Kotlin and I have question as I dont fully understand the principle of Unit:
onChecked:(Boolean) -> Unit
Does it pass the certain data as parameter to other function ( as a Unit)?
>Solution :
(Boolean) -> Unit is a function type. Before the arrow are the parameters, in this case a Boolean and after the arrow is the return type. Unit simply means that it doesn’t return anything.
See also this documentation