Hi, I'm new to flutter, I have a questionnaire with alternatives, when I load the first question with its alternatives it lets me select, I go to the second question and it goes well, but when I return to the previous question it does not let me select to change of option.
but I go back to the previous question to select another alternative and it does not let me select
the radio button is generated depending on how many alternatives you have in the question
new FutureBuilder ( future: getAlt (), builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.data == null) { return new Container ( child: new Center ( child: new Text ('no data ...'), ), ); } else { return new ListView.builder ( shrinkWrap: true, itemCount: snapshot.data.length, itemBuilder: (BuildContext context, int index) {
return new Container(
child: new Column(
children: <Widget>[
new Container(
child: new Row(
children: <Widget>[
new Expanded(
flex: 1,
child: new Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
new Container(
child: new Radio(
value: 1+ index,
groupValue: _selected,
onChanged: (int value) {
onChanged(value);
}),
),
],
)),
new Expanded(
flex: 3,
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Container(
child: new Text(
snapshot.data[index].alternativa,
textAlign: TextAlign.start,
style: TextStyle(color: Color(0xFF004669))
),
)
],
))
],
),
)
],
)
);
});
}
},
);