如何在flutter中设置右侧RadioButtonListTile中的Radio按钮

Mah*_*oon 4 dart flutter

我有以下 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)