How to set Radio button in RadioButtonListTile at the right in flutter

Viewed 719

I have the below RadioButtonListTile as the below code:

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,
    );
  }
}

and It shows like this picture:

enter image description here

So is it able to make the radio button shows at the right as the below picture:

enter image description here

1 Answers

Try adding controlAffinity: ListTileControlAffinity.trailing to your RadioListTile

Something like this:

return RadioListTile<Delivery>(
      value: value,
      groupValue: groupValue,
      onChanged: onChanged,
      title: title,
      subtitle: subtitle,
      activeColor: activeColor,
      controlAffinity: ListTileControlAffinity.trailing,
    );
Related