chanjungskim
04/24/2023, 9:37 AMval mobileMidValue by rememberSaveable { mutableStateOf(shippingAddress.mobileData.second.orEmpty()) }
val mobileLastValue by rememberSaveable { mutableStateOf(shippingAddress.mobileData.third.orEmpty()) }
I am using like this, So, I'd like to initialize the value only once?Loney Chou
04/24/2023, 9:53 AMval mobileMidValue = rememberSaveable { shippingAddress.mobileData.second.orEmpty() }
? 🤔chanjungskim
04/24/2023, 9:54 AMchanjungskim
04/24/2023, 9:54 AMchanjungskim
04/24/2023, 9:55 AMchanjungskim
04/24/2023, 9:56 AMLoney Chou
04/24/2023, 9:57 AMchanjungskim
04/24/2023, 9:59 AMchanjungskim
04/24/2023, 9:59 AMchanjungskim
04/24/2023, 10:03 AMval mobileMidValue by rememberSaveable(Unit) { mutableStateOf(shippingAddress.mobileData.second.orEmpty()) }
or
LaunchEffect(Unit) {
mobileMidValue = shippingAddress.mobileData.second.orEmpty()
...
}
Since, the address is empty at first, it just initialize empty String. But, I'd. like to initialize them when there are data. And it will be the first data that I want to initialize.chanjungskim
04/24/2023, 10:20 AMdewildte
04/24/2023, 9:15 PM