ListView showSuppliersList(List<Suppliers>? suppliersList) {
int? id = -1;
return ListView.builder(
    itemCount: suppliersList!.length,
    itemBuilder: (context, index) {
      return StatefulBuilder(
        builder: (context, setState) {
          return RadioListTile<int>(
              value: index,
              groupValue: id,
              title: Text(suppliersList[index].supplierName),
              onChanged: (value) {
                setState(() {
                  id = value;
                });
              }, 
           );
        },
      );
    });
 }

I want to select only single item in RadioListTile, it selects two items not single. Here an image


Solution 1: Deepak Lohmod

The reason is you are rebuilding that tile only. Due to which the state of previous tile is not rebuilt. So Wrap your listview.builder with statefulbuilder rather then wrapping the RadioListTile.

StatefulBuilder(
        builder:(c,setState){
          return ListView.builder(
    itemCount: suppliersList!.length,
    itemBuilder: (context, index) {
      return RadioListTile<int>(
              value: index,
              groupValue: id,
              title: Text(suppliersList[index].supplierName),
              onChanged: (value) {
                setState(() {
                  id = value;
                });
              }, 
           );
    });
        }
        )