Skip to content

Read and update data using Room - adding function to ViewModel #203

@lisaminogue1

Description

@lisaminogue1

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

In which task and step of the codelab can this issue be found?
Step 8. Implement sell item

Under Add a function in the View Model, step 3.

Describe the problem
Text says to creat a val called currentItem and set it to uiState.value.toItem()
code block shows the same.

However, example of the full function under step 5 shows the correct code:
val currentItem = uiState.value.itemDetails.toItem()

itemDetails() was missing in the text and first codeblack. Missing itemDetails() leads to compiler error for toItem()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions