I want the text to be taken from string resource, depends on item.route, which is specified before bellow code.
But whole "when" expression gives me the error: "Type mismatch: inferred type is () -> Int but Int was expected." I don't have idea how to resolve it.
Text(
text = stringResource(id = {
when (item.route) {
"menu_screen" -> R.string.menu
"orders_screen" -> R.string.orders
else -> R.string.orders
}
}),
textAlign = TextAlign.Center
)