我有以下 RadioButtonListTile 作为以下代码:
import 'package:flutter/material.dart';
import 'package:getxflutter/helper/enum.dart';
class DeliveryTypesRadioListTile extends StatelessWidget {
final dynamic value;
final dynamic groupValue;
final Function onChanged;
final Widget title;
final Widget subtitle;
final Color activeColor;
const DeliveryTypesRadioListTile({
Key key,
@required this.value,
@required this.groupValue,
@required this.onChanged,
@required this.title,
@required this.subtitle,
@required this.activeColor,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return RadioListTile<Delivery>(
value: value,
groupValue: groupValue,
onChanged: onChanged,
title: title,
subtitle: subtitle,
activeColor: activeColor,
);
}
}
Run Code Online (Sandbox Code Playgroud)
它显示如下图所示:
那么是否可以让单选按钮显示在右侧,如下图所示:
kfo*_*jan 11
尝试添加controlAffinity: ListTileControlAffinity.trailing到您的RadioListTile
像这样的东西:
return RadioListTile<Delivery>(
value: value,
groupValue: groupValue,
onChanged: onChanged,
title: title,
subtitle: subtitle,
activeColor: activeColor,
controlAffinity: ListTileControlAffinity.trailing,
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2324 次 |
| 最近记录: |