File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
ui/src/main/java/io/snabble/sdk/ui/cart/shoppingcart Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
77### Removed
88### Fixed
99
10+ ## [ 0.75.0]
11+ ### Added
12+ * ui: add function ` updateCart() ` to update the cart manually for the ` ShoppingCartScreen `
13+
1014## [ 0.75.0]
1115### Changed
1216* ui: update fiserv 3D's flow. The user now has to enter additional information to add a credit card.
Original file line number Diff line number Diff line change 11package io.snabble.sdk.ui.cart.shoppingcart
22
33import androidx.compose.foundation.ExperimentalFoundationApi
4- import androidx.compose.foundation.background
54import androidx.compose.foundation.layout.fillMaxWidth
65import androidx.compose.foundation.lazy.LazyColumn
76import androidx.compose.foundation.lazy.items
87import androidx.compose.material3.HorizontalDivider
9- import androidx.compose.material3.MaterialTheme
108import androidx.compose.runtime.Composable
119import androidx.compose.ui.Modifier
1210import androidx.compose.ui.input.nestedscroll.nestedScroll
@@ -138,7 +136,9 @@ private fun CardWithUserWeightedItems() {
138136 items = listOf (
139137 ProductItem (
140138 ShoppingCart .Item (ShoppingCart (), LineItem (name = " Cold brew Coffee" ))
141- .apply { product = Product .Builder ().setType(Product .Type .UserWeighed ).build() },
139+ .apply {
140+ product = Product .Builder ().setType(Product .Type .UserWeighed ).build()
141+ },
142142 name = " Apple" ,
143143 quantity = 1 ,
144144 editable = true ,
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ class ShoppingCartViewModel : ViewModel() {
3030 }
3131 }
3232
33+ fun updateCart () {
34+ updateUiState(cachedCart)
35+ }
36+
3337 init {
3438 val project = Snabble .checkedInProject.value
3539 val cart = Snabble .checkedInProject.value?.shoppingCart
You can’t perform that action at this time.
0 commit comments