I have a radio buttons ListView
that I want to transform it into a searchable dropdown menu.
I search and saw some videos on YouTube but it does not work with me, maybe because I'm new to Flutter, also my items were retrieved from Firebase and I could not list them in the dropdown menu. If anyone can help I will be thankful.
Here is my code:
ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemCount: selectedCategory!.tags!.length,
itemBuilder: (context, index) {
return SizedBox(
width: MediaQuery.of(context).size.width *
0.35, // <= give specific width
child: ListTileTheme(
horizontalTitleGap: 0.2,
child: RadioListTile(
contentPadding: const EdgeInsets.only(
left: 0, right: 0),
visualDensity: const VisualDensity(
horizontal:
VisualDensity.minimumDensity,
),
title: Text(
selectedCategory!.tags![index],
style: const TextStyle(
color: textColor)),
groupValue: tag,
value: selectedCategory!.tags![index],
activeColor: primary,
onChanged: (value) {
setState(() {
tag = value;
});
},
),
),
);
},
)