fix(ui): list/staggered items alias to fix unresolved references
This commit is contained in:
1 parent
5196d9da10
commit
04be5d06f0
1 file changed
+5
-3
@@ -12,9 +12,11 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items as lazyListItems
|
||||
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
|
||||
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
|
||||
import androidx.compose.foundation.lazy.staggeredgrid.items
|
||||
import androidx.compose.foundation.lazy.staggeredgrid.items as staggeredItems
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Card
|
||||
@@ -254,7 +256,7 @@ private fun ProductListScreen(
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
items(products, key = { it.id }) { p ->
|
||||
staggeredItems(products, key = { it.id }) { p ->
|
||||
ElevatedCard(onClick = { onClick(p) }, modifier = Modifier.fillMaxWidth()) {
|
||||
Column(Modifier.padding(10.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
ProductCover(p.imageUrl)
|
||||
@@ -375,7 +377,7 @@ private fun CartScreen(
|
||||
EmptyState("购物车为空")
|
||||
} else {
|
||||
LazyColumn(verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
items(items) { item ->
|
||||
lazyListItems(items) { item ->
|
||||
val product = productMap[item.productId]
|
||||
if (product != null) {
|
||||
Card(Modifier.fillMaxWidth()) {
|
||||
|
||||
Reference in new issue
Block a user