You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
(8) Implement and Sell Item
Add a function in the ViewModel
Inside the launch block, create a val called currentItem and set it to uiState.value.toItem().
val currentItem = uiState.value.toItem()
The uiState.value is of the type ItemUiState. You convert it to the Item entity type with the extension function toItem().
Describe the problem
The instructions say that the uiState.value is of the type ItemUiState. It is not. It is of the type ItemDetailsUiState. Therefore, the correct code is uiState.value.itemDetails.toItem(), which you correctly have a subsequent code snippet after number list item 5.
I believe that, in order to fix this issue, you must change 3 places:
change the instructions in numbered item 3 to end with uiState.value.itemDetails.toItem()
change the code snippet following numbered item 3 to end with uiState.value.itemDetails.toItem()
change the text after the code snippet to say that uiState.value is of type ItemDetailsUiState, and also that in order to convert it to the Item entity type you need to access the property/member itemDetails and then use the extension function toItem().
Steps to reproduce?
n/a
Versions
n/a
Additional information
The text was updated successfully, but these errors were encountered:
URL of codelab:
https://developer.android.com/codelabs/basic-android-kotlin-compose-update-data-room?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-6-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-update-data-room#7`
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
(8) Implement and Sell Item
Add a function in the
ViewModel
val
calledcurrentItem
and set it touiState.value.toItem()
.val currentItem = uiState.value.toItem()
The
uiState.value
is of the typeItemUiState
. You convert it to the Item entity type with the extension functiontoItem()
.Describe the problem
The instructions say that the
uiState.value
is of the typeItemUiState
. It is not. It is of the typeItemDetailsUiState
. Therefore, the correct code isuiState.value.itemDetails.toItem()
, which you correctly have a subsequent code snippet after number list item 5.I believe that, in order to fix this issue, you must change 3 places:
uiState.value.itemDetails.toItem()
uiState.value.itemDetails.toItem()
uiState.value
is of typeItemDetailsUiState
, and also that in order to convert it to the Item entity type you need to access the property/member itemDetails and then use the extension functiontoItem()
.Steps to reproduce?
n/a
Versions
n/a
Additional information
The text was updated successfully, but these errors were encountered: