You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decided to use the TextField's error argument. But the red icon is always visible
How do I use it? my first try was this
TextField(value = server,
modifier =Modifier.fillMaxWidth(),
error = {
if (errors.value isErrors.BadServer) {
Text(text ="Can not connect to this server")
}
},)
That did not work because it checks if the argument is null and then displays red icon. My second try was:
val error = @Composable { if (errors.value isErrors.BadServer) {
Text(text ="Can not connect to this server")
} elsenull }
TextField(value = server,
modifier =Modifier.fillMaxWidth(),
error = error) // here I get error "The feature "unit conversion" is disabled"
But there I get compilation error. Of course I could duplicate it and wrap whole TextField in if statement, but this feels wrong (lots of arguments will be duplicated). So how can I use it?
Decided to use the TextField's
errorargument. But the red icon is always visibleHow do I use it? my first try was this
That did not work because it checks if the argument is null and then displays red icon. My second try was:
But there I get compilation error. Of course I could duplicate it and wrap whole TextField in if statement, but this feels wrong (lots of arguments will be duplicated). So how can I use it?