I have a list of items and other views in the column. I want to set scrollable to the column but I get an error.
My screen code:
val context = LocalContext.current
Box(
modifier = modifier
.fillMaxSize()
) {
val state = viewModel.state.value
val scrollState = rememberScrollState()
Column(modifier = modifier.fillMaxSize().verticalScroll(scrollState)) {
Spacer(modifier = Modifier.size(24.dp))
AccountNameSection(modifier = modifier)
Spacer(modifier = Modifier.size(24.dp))
if (!state.items.isNullOrEmpty()) {
Box(modifier = modifier.fillMaxSize()) {
LazyColumn(modifier = modifier.fillMaxSize()) {
items(state.items) { item ->
ProfileListItems(item = item, onItemClick = {
})
}
}
}
}
Text(text = context.getAppVersionName())
}
if (state.error.isNotBlank())
SimpleSnackbar(
text = state.error,
modifier = modifier.align(Alignment.BottomCenter)
)
if (state.isLoading)
Loading(modifier = modifier.align(Alignment.BottomCenter))
}
This is the error: