This is my code:
Text(
text = "Resend OTP",
fontSize = 20.sp,
color = Textfieldcolor,
style = TextStyle(textDecoration = TextDecoration.Underline)
)
I want the text to be clickable once and then disabled.
How do I do this?
You can add the clickable modifier to your Text or use ClickableText instead of Text.
Here is an example of how to do it with ClickableText:
var enabled by remember { mutableStateOf(true)}
ClickableText(
text = AnnotatedString(text) ,
onClick = {
if (enabled) {
enabled = false
text = "Disabled"
}
})