'Trigger new OutlinedTextField when the first one is filled
I am trying to achieve the creation of a user questionnary. So I have one input text field and I want to add more if the first one is filled with text.
Here my compose function to display the input field.
@Composable
private fun displayQuestion(number: String) {
var question by remember { mutableStateOf("")}
OutlinedTextField(
value = question,
onValueChange = {
question = it
},
label = { Text(stringResource(R.string.question) + " n°$number") }
)
if (question !== "") {
lastQuestionNumber += 1
}
}
I can't figure out how to call this one if the question variable is different from "".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
