I have a list of RadioListTile in a DraggableScrollabeSheet. When I tap on one of the RadioListTile, a TextField appears. But immediately I tap on the textField, I get a SetState response and option goes back to option 1. So I can't type anything in the TextField.
List<String> options1 = [
"A",
"B",
"C",
"D",
"Others"
...
];
String currentOption = options[0];
Column(
children:[
RadioListTile(
activeColor: Colors.red,
title: Text("A"),
value: options[0],
groupValue: currentOption,
onChanged: (value){
setState((){
currentOption = value.toString();
})
}
)
.....//This continues till the last option
//Then if the last option (Other) is chosen, a textfield is displayed
currentOption == options[4]?
TextField(
.....
):SizedBox(),
]
)
So this is where when I tap on the textfield, it sets state and the current option moves back to options[0]