I am making one quiz app. I have 10 questions list and each have four option. User select answer one by one. Then all answers save and give result in last screen.
//This is a code of radiobuttongroup
child: RadioButtonGroup(
padding: EdgeInsets.all(20.0),
labels: <String>[
que_list[index]['option_list'][0],
que_list[index]['option_list'][1],
que_list[index]['option_list'][2],
que_list[index]['option_list'][3]
],
labelStyle: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: Colors.white),
onChange: (String label, int index) {},
onSelected: (String selected) async {
setState(() {
_picked = selected;
});
//print(selected);
print(">>>>>>>>>" + _picked);
},
picked: _picked,
activeColor: Colors.white,
},
),
I am getting data from API.