【发布时间】:2022-07-22 21:06:08
【问题描述】:
我能够成功地应用单选按钮点击单选按钮,但我正在寻找一种方法来解决如何应用下面整行的单选按钮是我的代码:
Row(
children: [
Radio<String>(
value: 'pay',
activeColor: colorBlue,
groupValue: _selectedPaymentMethod,
fillColor:
MaterialStateColor.resolveWith((states) => Colors.grey[300]),
onChanged: (value) {
setState(() {
_selectedPaymentMethod = value;
});
},
),
Icon(
Icons
.monetization_on,
size: 45,
),
SizedBox(width: 20,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment:Alignment.centerLeft,
child:Text( "Credit")),
SizedBox(height: 3,),
Align(
alignment:Alignment.centerLeft,
child:Text( "Coming soon!",style: TextStyle(
color: Colors.grey[400],fontSize: 12,
fontWeight: FontWeight.normal,
fontFamily: 'Montserrat'),)),
Align(
alignment:Alignment.centerLeft,
child:Text( "200USD"))
],)
],)
如果有人可以帮助我解决如何在整个 Row 上应用 onclick 并获得与上述代码中 Radio 相同的值,我将非常高兴,在此先感谢。
【问题讨论】:
标签: flutter radio-button radio-group radio