I am using flutter-SQLite-Dart to develop a mobile application. with radio list tile I have assigned a radio button and passed a value of index. When executing the application I am able to click all the radio buttons. I need to make the list of radio buttons to be clickable only once, when I have selected one radio button the others should not be selected. This is the requirement.
return InkWell(
onTap: press,
child: Container(
child: Row(
children: <Widget>[
Expanded(
child: Container(
height: 60.0,
child: Theme(
data: Theme.of(context).copyWith(
unselectedWidgetColor: Colors.grey,
disabledColor: Colors.blue),
child: Column(children: [
RadioListTile(
title: Text("${sample[index]}",
style:
TextStyle(color: Colors.black)),
groupValue: id,
value: index,
activeColor: Colors.green,
onChanged: (val) {
setState(() {
id = val;
debugPrint('val answer$val');
});
},
toggleable: true,
),
]),
)),
),
],
),
),
);
The output of the application

Hi Please check my answer below. I have used statefull widget.
import 'package:flutter/material.dart';