androidkotlinandroid-jetpack-composematerial-components-androidandroid-dark-theme

color of text changes to white in dark theme


Text(
           style = profileItem
           text = priceStyle(order.total!!),
           modifier = Modifier
                      .padding(start = 2.dp),
     )

val profileItem = TextStyle(
    color = Color.Black,
    fontFamily = FontFamily(Font(R.font.yekanbakhfanum_semibold)),
    fontSize = 14.sp,
    textAlign = TextAlign.Start,
    textDirection = TextDirection.Rtl
)

I am using the code above so I want the text color to be black despite the fact that user phone is in dark mode or not but still it's color changes to white in dark theme

I deleted my darkColors and the theme related to it also copied the lightColors and used them as dark theme too but none of them worked


Solution