I'm trying to display a profile screen using:
Scaffold(
topBar = {
DarkTopBar()
},
content = ProfileContent()
)
Where the ProfileContent()
looks like this:
@Composable
fun ProfileContent() {
Box(
modifier = Modifier.fillMaxSize().padding(top = 96.dp),
contentAlignment = Alignment.TopCenter
) {
Text(
text = "Good day!",
fontSize = 48.sp
)
}
}
But I get the following error:
Type mismatch: inferred type is Unit but (PaddingValues) -> Unit was expected
What I have tried to solve this problem is to move the above function call inside the body:
Scaffold(
topBar = {
DarkTopBar()
}
) {
ProfileContent() //Moved here.
}
But Android Studio is complaining saying:
Content padding parameter it is not used
Can anyone help me?