When ever I use the Text()
function, it shows this error:
None of the following functions can be called with the arguments supplied.
Text(AnnotatedString, Modifier = ..., Color = ..., TextUnit = ..., FontStyle? = ..., FontWeight? = ..., FontFamily? = ..., TextUnit = ..., TextDecoration? = ..., TextAlign? = ..., TextUnit = ..., TextOverflow = ..., Boolean = ..., Int = ..., Int = ..., Map<String, InlineTextContent> = ..., (TextLayoutResult) → Unit = ..., TextStyle = ...)
I tried to create a seperate function for this, but the text field does not get executed:
fun Text(s: String, Style: TextStyle) {
}
Although errors get removed by using seperate functions.
You are attempting to override a NEW "Text" function, which cannot be overridden. If you want to create a new Text, try using this code.
@Composable
fun MyText(s: String, style: TextStyle) {
Text(text = s, style = style) }