Asad Mukhtar
08/17/2022, 6:22 AMderivedStateOf {
buildAnnotatedString {
withStyle(
style = SpanStyle(
color = PrimaryTextColor,
fontSize = TextUnit(12f, TextUnitType.Sp),
fontFamily = FontFamily(listOf(Font(R.font.poppins_regular)))
)
) {
append(stringResource(R.string.dont_have_an_account))
}
withStyle(
style = SpanStyle(
color = BlueColor,
fontSize = TextUnit(12f, TextUnitType.Sp),
fontFamily = FontFamily(listOf(Font(R.font.poppins_semibold)))
)
) {
append(" Create Here")
}
}
}
Francesc
08/17/2022, 6:34 AMstringResource
is a composable function and you're not in a compose scope. Either read the string first and keep it in a variable, or keep Localcontext.current in a variable and then use getString on thatAsad Mukhtar
08/17/2022, 6:35 AMval context = LocalContext.current
append(context.resources.getString(R.string.dont_have_an_account))
Oleksandr Balan
08/17/2022, 6:36 AMAsad Mukhtar
08/17/2022, 6:37 AMval context = LocalContext.current
append(context.resources.getString(R.string.dont_have_an_account))
Oleksandr Balan
08/17/2022, 6:41 AMLocalContext.current
like you did 🤷Asad Mukhtar
08/17/2022, 6:42 AM