i have a list that was retrieved from the database and i want to show it as a horizontal radio button list. i tried to wrap it with a row but i got errors.
this my code that retrieved them vertically.
ListView.builder(
shrinkWrap: true,
itemCount: controller.doc.length,
itemBuilder: (context, index) {
return RadioListTile(
title: Text(controller.doc[index]['id'],
style: TextStyle(color: textColor)),
groupValue: tag,
value: controller.doc[index]['id'],
activeColor: primary,
onChanged: (value) {
setState(() {
tag = value;
});
},
);
},
),
RadioListTileis combination betweenRadiowidget andListTile. the ListTile will expand to the maximum width. that will caused error if you make your ListTile with scroll horizontally.its because the widget failed to hasSize. if its a must to use
ListTile, then this is one of solutionother solution is , make your custom radiolistile, eg: