v79
12/31/2022, 10:25 AMfun getVehicle(vehicleId: Long): Vehicle? {
val vehicle = viewModelScope.launch {
repository.getVehicleById(vehicleId)
}
return vehicle
}
I know this is wrong. I just can't get my head around what is right.v79
12/31/2022, 11:08 AMmutableStateOf
value. My code is going to have a `currentVehicle`and a selectedVehicle
and a vehicleToDelete
and should these be the vehicle IDs (from Room database) or actual entities or a DTO? All of them could be null, so it's a sea of vehicle?.let {...}
statements because you can't ever do a simple null check with an if statement. Very frustrating way to program if you ask me.Zun
12/31/2022, 12:01 PMZun
12/31/2022, 12:03 PMv79
12/31/2022, 12:04 PMZun
12/31/2022, 12:07 PMZun
12/31/2022, 12:07 PMv79
12/31/2022, 12:08 PMZun
12/31/2022, 12:08 PMv79
12/31/2022, 12:09 PMZun
12/31/2022, 12:09 PMZun
12/31/2022, 12:12 PMColton Idle
01/01/2023, 3:39 PMsuspend fun getVehicle(vehicleId: Long): Vehicle? {
val vehicle = repository.getVehicleById(vehicleId)
return vehicle
}
Colton Idle
01/01/2023, 3:40 PM