Ayfri
01/24/2022, 9:36 PMdata class ErrorCreate<T>(val error: String, val name: String, val value: T)
(I need to store the bad value and it can be a string/int/float/boolean)
Then I created this top-first variable
val canCreate = mutableStateListOf<ErrorCreate<*>>()
And for now I just have
Button(
enabled = canCreate.isEmpty(),
modifier = ...
) { Text("Create") }
And in my textfields onValueChange
function, I add an error to the canCreate
array if it is errored, otherwise I remove it filtered by name.
But, the problem is that when I add something to the list, my button is not directly updated but is next time the list changes, so it doesn't really work, is there any workaround or other solution to make this possible ?