虎視眈々と

Flutter × Firebaseを研究するアプリエンジニア

FlutterでRadioButtonを出す

f:id:superman199323:20190206120228p:plain

こんなやつを出す方法は下記です。

int _value1 = 0;
void _setvalue1(int value) => setState(() => _value1 = value);

Row(mainAxisAlignment: MainAxisAlignment.center, children: < Widget > [
  new Radio(value: 0, groupValue: _value1, onChanged: _setvalue1, ),
  new Text('男性', style: new TextStyle(fontSize: 16.0), ),
  new Radio(value: 1, groupValue: _value1, onChanged: _setvalue1, ),
  new Text('女性', style: new TextStyle(fontSize: 16.0, ), ),
], ),