Syntax
RadioListTile(
title: const Text('Option 1'),
value: 1,
groupValue: selectedValue,
onChanged: (value) {
setState(() {
selectedValue = value;
});
},
),
eg
return Center(
child: Column(
children: [
RadioListTile(
title: const Text('Pomme'),
value: 'Pomme',
groupValue: selectedFruit,
onChanged: (String? value) {
setState(() {
selectedFruit = value;
});
},
),
RadioListTile(
title: const Text('Banane'),
value: 'Banane',
groupValue: selectedFruit,
onChanged: (String? value) {
setState(() {
selectedFruit = value;
});
},
),
RadioListTile(
title: const Text('Cerise'),
value: 'Cerise',
groupValue: selectedFruit,
onChanged: (String? value) {
setState(() {
selectedFruit = value;
});
},
),
],
),
);