title: Dynamically create radio button Group in ListView.builder() flutter
body: <p><strong>I want to create such a UI</strong></p>
  <p><a href="https://i.stack.imgur.com/2pgm0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2pgm0.png" alt="" /></a></p>
  <p>with in which ,in the last, i get the details of all the radio Buttons selected.</p>
  <p><strong>and this is My Full code</strong></p>
  <p>And when i tried to do this,all radio button are turned to one side.</p>
  <pre><code>import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  
  class Affiche_grille extends StatefulWidget {
    @override
    _QuestionWidgetState createState() =&gt; _QuestionWidgetState();
  }
  
  int selectedRadio;
  int _groupValue = -1;
  
  class _QuestionWidgetState extends State&lt;Affiche_grille&gt; {
    List&lt;RadioModel&gt; sampleData = new List&lt;RadioModel&gt;();
  
    @override
    void initState() {
      super.initState();
      sampleData.add(new RadioModel(false, 'A', 'April 18', 'text1'));
      sampleData.add(new RadioModel(false, 'B', 'April 17', 'text2'));
      sampleData.add(new RadioModel(false, 'C', 'April 16', 'text3'));
      sampleData.add(new RadioModel(false, 'D', 'April 15', 'text4'));
    }
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          title: new Text(&quot;ListItem&quot;),
        ),
        body: ListView.builder(
          itemCount: sampleData.length,
          itemBuilder: (context, index) =&gt; ButtonBar(
            alignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              _myRadioButton(
                title: &quot;Checkbox 0&quot;,
                value: 0,
                onChanged: (newValue) =&gt; setState(() =&gt; _groupValue = newValue),
              ),
              _myRadioButton(
                title: &quot;Checkbox 1&quot;,
                value: 1,
                onChanged: (newValue) =&gt; setState(() =&gt; _groupValue = newValue),
              ),
            ],
          ),
        ),
      );
    }
  }
  
  Widget _myRadioButton({String title, int value, Function onChanged}) {
    return Radio(
      value: value,
      groupValue: _groupValue,
      onChanged: onChanged,
    );
  }
  
  class RadioModel {
    bool isSelected;
    final String buttonText;
    final String text;
    final String text1;
  
    RadioModel(this.isSelected, this.buttonText, this.text, this.text1);
  }
  </code></pre>
  <p><strong>This APPlication UI is made from this CODE.</strong></p>
  <p><a href="https://i.stack.imgur.com/OrkVk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OrkVk.jpg" alt="enter image description here" /></a></p>