title: Flutter OnChanged behaviour in Radios with multiple groups not working as expected
body: <p>Hi The problem is I have multiple groups of RadioButtons hence can't figure out how onChanged method will work for each group.
   I have a list of students and want to make a widget where a teacher can mark attendance of students by clicking on one of the Radio Buttons( present,absent,holiday,half day etc.)
  Here is the implementation</p>
  
  <pre><code>@override
  Widget build(BuildContext context) {
  print('number students ${studentList.students.length.toString}');
  return ListView.builder(
      itemCount: studentList.students.length,
      itemBuilder: (context, index) {
        var gp = studentList.students[index].id;
        return Padding(
          padding: const EdgeInsets.all(8.0),
          child: Card(
            elevation: 10,
            child: ListTile(
              title: Padding(
                padding: const EdgeInsets.only(top: 8.0),
                child: Text(
                  studentList.students[index].name,
                  style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
                ),
              ),
              leading: CircleAvatar(
                  radius: 30,
                  backgroundImage: NetworkImage(
                      studentList.students[index].details['photo'])),
              trailing: Column(
                children: &lt;Widget&gt;[],
              ),
              subtitle: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: &lt;Widget&gt;[
                  Text('Phone: ' +
                      studentList.students[index].details['phone']),
                  Text('Batches:'),
                  Container(
                    width: MediaQuery.of(context).size.width,
                    height: 50,
                    child: ListView.builder(
                      itemCount: studentList.students[index].batches.length,
                      itemBuilder: (context, batchIndex) {
                        return Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: &lt;Widget&gt;[
                            Text(studentList
                                .students[index].batches[batchIndex].name),
                          ],
                        );
                      },
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      children: &lt;Widget&gt;[
                        Column(
                          children: &lt;Widget&gt;[
                            Radio(
                              groupValue: gp,
                              value: 0,
                              onChanged: (int e) {
                                print(e);
                                print(gp);
                                updateSelectedAttendance(gp, e);
  
                              },
                            ),
                            Text('P')
                          ],
                        ),
                        Column(
                          children: &lt;Widget&gt;[
                            Radio(
                              groupValue: gp,
                              onChanged: (int e) {
                                print(e);
                                print(gp);
                                updateSelectedAttendance(gp, e);
  
                              },
                              value: 1,
                            ),
                            Text('Ab')
                          ],
                        ),
                        Column(
                          children: &lt;Widget&gt;[
                            Radio(
                              groupValue: gp,
                              onChanged: (int e) {
                                print(e);
                                print(gp);
                                updateSelectedAttendance(gp, e);
  
                              },
                              value: 2,
                            ),
                            Text('Hd')
                          ],
                        ),
                        Column(
                          children: &lt;Widget&gt;[
                            Radio(
                              groupValue: gp,
                              onChanged: (int e) {
                                print(e);
                                print(gp);
                                updateSelectedAttendance(gp, e);
  
                              },
                              value: 3,
                            ),
                            Text('H')
                          ],
                        )
                      ],
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      });
  </code></pre>
  
  <p>}</p>
  
  <pre><code> updateSelectedAttendance(int gp, int e) {
  setState(() {
    gp = e;
    print('gp ${gp.toString()} -- e ${e.toString()}');
  });
  </code></pre>
  
  <p>}</p>
  
  <p><a href="https://i.stack.imgur.com/ctCGC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ctCGC.png" alt="enter image description here"></a></p>
  
  <p>Here because there would be multiple students , hence there would be multiple groups of Radio Buttons so I have assigned each group a groupValue of id of the individual student. And because there are 4 radio buttons for each student (present,absent,holiday,halfday), I have assigned values of 0,1,2,3. And in onChanged method I am equating gp=value;
  But it is not behaving the way I want it to behave. </p>