Replies: 1 comment 1 reply
-
TextField(
value = server,
modifier = Modifier.fillMaxWidth(),
error = if (errors.value is Errors.BadServer) {
@Composable { Text(text = "Can not connect to this server") }
} else {
null
},
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shalva97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Decided to use the TextField's
error
argument. 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?
Beta Was this translation helpful? Give feedback.
All reactions