title: flutter - how can save state selected radio button list in flutter?
body: <p>I managed to display a <code>RadioListTile</code> List based on the data I have.
  see my code below:</p>
  
  <pre><code>class ShipFromItemList extends StatefulWidget {
    @override
    _ShipFromItemListState createState() =&gt; _ShipFromItemListState();
  }
  
  class _ShipFromItemListState extends State&lt;ShipFromItemList&gt; {
    ShippingAddress _radioValue;
  
    @override
    Widget build(BuildContext context) {
      return ScopedModelDescendant&lt;MainModel&gt;(builder: (context, child, model) {
        return ListView(shrinkWrap: true, children: createRadioListUsers(model));
      });
    }
  
    List&lt;Widget&gt; createRadioListUsers(MainModel model) {
      List&lt;Widget&gt; widgets = [];
      for (ShippingAddress shippingAddress in model.shipaddrsList) {
        widgets.add(Column(
          children: &lt;Widget&gt;[
            SizedBox(height: 10),
            Container(
              child: RadioListTile(
                value: shippingAddress,
                groupValue: _radioValue,
                title: Text(
                  shippingAddress?.name ?? "",
                  style: Theme.of(context).textTheme.title.copyWith(fontSize: 15),
                ),
                subtitle: Text(
                  shippingAddress?.address ?? "",
                  style:
                      Theme.of(context).textTheme.caption.copyWith(fontSize: 13),
                ),
                secondary: Text("14.728 mi",
                    style: Theme.of(context)
                        .textTheme
                        .caption
                        .copyWith(fontSize: 13)),
                onChanged: (currentUser) {
                  print("Current User ${currentUser?.name}");
                  setSelectedUser(currentUser);
                },
                selected: _radioValue == shippingAddress,
                activeColor: Colors.orange,
              ),
            ),
            SizedBox(height: 10),
            Divider(
              height: 0.0,
            ),
          ],
        ));
      }
      return widgets;
    }
  
    setSelectedUser(ShippingAddress shippingAddress) {
      setState(() {
        _radioValue = shippingAddress;
      });
    }
  }
  </code></pre>
  
  <p>But, I want when one day returns to the <code>Select Radio</code> page, the initialize selected radio is the last data (which I will save firebase later).. What data do I have to save in order to maintain the latest data as initialize selected radio?</p>