-
Notifications
You must be signed in to change notification settings - Fork 133
Description
name: Read and update data using Room issue template.
about: Issue template for Read and update data using Room
title: Read and update data using Room
labels: ''
assignees: ''
In my opinion, in the ItemDetailsScreen.kt file, the ItemDetailsBody() function should wrap the composable Button with if (itemUiState.itemDetails.toItem().quantity > 0), otherwise the sell button will appear even if the quantity is 0.
Furthermore, in my opinion, in the ItemDao.kt file, fun getItem(id: Int): Flow should be replaced with fun getItem(id: Int): Flow<Item?>, otherwise, if an item is deleted, the following exception occurs: java.lang.IllegalStateException: The query result was empty, but expected a single row to return a NON-NULL object of type <com.example.inventory.data
.Item>.
Versions
_Android Studio version:_Narwhal Feature Drop | 2025.1.2
_API version :_Android 11 (API level 30)