mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Add: Null safety for compose recyclers
This commit is contained in:
parent
5ab12c9c93
commit
4c019d13ca
@ -12,14 +12,14 @@ import com.looker.droidify.entity.ProductItem
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProductsVerticalRecycler(
|
fun ProductsVerticalRecycler(
|
||||||
productsList: List<Product>,
|
productsList: List<Product>?,
|
||||||
repositories: Map<Long, Repository>,
|
repositories: Map<Long, Repository>,
|
||||||
onUserClick: (ProductItem) -> Unit = {}
|
onUserClick: (ProductItem) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
verticalArrangement = spacedBy(2.dp)
|
verticalArrangement = spacedBy(2.dp)
|
||||||
) {
|
) {
|
||||||
items(productsList) { product ->
|
items(productsList ?: emptyList()) { product ->
|
||||||
product.item.let { item ->
|
product.item.let { item ->
|
||||||
ProductRow(item, repositories[item.repositoryId], onUserClick)
|
ProductRow(item, repositories[item.repositoryId], onUserClick)
|
||||||
}
|
}
|
||||||
@ -29,14 +29,14 @@ fun ProductsVerticalRecycler(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProductsHorizontalRecycler(
|
fun ProductsHorizontalRecycler(
|
||||||
productsList: List<Product>,
|
productsList: List<Product>?,
|
||||||
repositories: Map<Long, Repository>,
|
repositories: Map<Long, Repository>,
|
||||||
onUserClick: (ProductItem) -> Unit = {}
|
onUserClick: (ProductItem) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
LazyRow(
|
LazyRow(
|
||||||
horizontalArrangement = spacedBy(2.dp)
|
horizontalArrangement = spacedBy(2.dp)
|
||||||
) {
|
) {
|
||||||
items(productsList) { product ->
|
items(productsList ?: emptyList()) { product ->
|
||||||
product.item.let { item ->
|
product.item.let { item ->
|
||||||
ProductColumn(item, repositories[item.repositoryId], onUserClick)
|
ProductColumn(item, repositories[item.repositoryId], onUserClick)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user