Jetpack Compose – How can we call a @Composable function inside an onClick()

So you’re right, composable functions cannot be called from within onClicks from either a button or a modifier. So you need to create a value like: private val showDialog = mutableStateOf(false) When set to true you want to invoke the composable code, like: if(showDialog.value) { alert() } Alert being something like: @Composable fun alert() { … Read more

textAllCaps in jetpack compose

There’s not such property, but you can create it by yourself: @Composable fun CapsText( text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, textAlign: TextAlign? = null, lineHeight: TextUnit = … Read more