Tiago Nunes
07/21/2021, 10:47 AMval nameFieldLiveData = savedStateHandle.getLiveData(NAME_FIELD_KEY, "")
val nameFieldFlow: Flow<String> = maxPassengersLive.asFlow()
fun setNameField(name: String) {
nameFieldLiveData.value = name
}
It would be great if there was a savedStateHandle.getFlow which returned a MutableStateFlow, right?
Our main issue with LiveData is the fact that it holds a String! instead of a String. So in the case of my example, nameFieldFlow becomes a Flow<String!>, unless I specify the type explicitly. And I always forget to specify the type explicitlyallan.conda
07/21/2021, 11:05 AMallan.conda
07/21/2021, 11:06 AMandroidx:savedstatehandle-flow
artifact, who knows 😛