first, sorry for my bad eng.
using this app and
reading this chapter
class ItemDetailsViewModel
has a statement below.
private val itemId: Int = checkNotNull(savedStateHandle[ItemDetailsDestination.itemIdArg])
I have known savedStateHandle must have a setting section likeoperator fun set(key: String, value: Any?) { initialState[key] = value }
so savedStateHandle loads the value using the key.
At this point, I couldn't find savedStateHandle
set his value using ItemDetailsDestination.itemIdArg
key in the app.
Asking ChatGPT, savedStateHandle
can't create value automatically, they must directly set the key-value map. But also ChatGPT can't find the setting point.
Am I curious for Being of no use? I can't sleep until I find the answer.Please somebody put me to sleep.