private fun saveSelectedState(stateSelected: Int) { _uiState.value = uiState.value.copy( addressFields = uiState.value.addressFields.copy( selectedState = uiState.value.addressFields.selectedState.copy( value = uiState.value.stateList[stateSelected].name ) ) ) _uiState.value = uiState.value.copy( selectedStateAbb = uiState.value.stateList[stateSelected].regionCode ) }
This method saves the selected state in the View-state