如何在单选列表图块中添加尾随图标

问题描述 投票:0回答:1

[我正在使用 RadioListTile用于用单选按钮显示动态数据,但是I want显示相同的列表,并带有用于编辑列表数据的尾随图标。

  • 您能帮我扑朔迷离吗?

                 RadioListTile(
                            groupValue: _currentIndex,
                            title: Text(
    //                                          addres["address_1"],
                              addres["firstname"] +
                                  addres["lastname"] +
                                  addres["address_1"] +
                                  addres["city"] +
                                  addres["country"],
                              overflow: TextOverflow.ellipsis,
                              maxLines: 3,
                              style: TextStyle(color: Colors.black, fontSize: 16.0),
                            ),
                            value: int.parse(addres["address_id"]),
                            onChanged: (val) {
                              setState(() {
                                _currentIndex = val;
                                Navigator.push(
                                    context,
                                    MaterialPageRoute(
                                        builder: (context) => PickanAddresspage(selected_address: addres['address_id'],)));
                              });
                            },
    
                          )
    
flutter radiobuttonlist
1个回答
0
投票

在标题中,您可以使用Row来包装文本和图标代码段

RadioListTile<SingingCharacter>(
          title: Row(
            children: <Widget>[
              Text(
                "firstname" + "lastname" + "address_1" + "city" + "country",
                overflow: TextOverflow.ellipsis,
                maxLines: 3,
                style: TextStyle(color: Colors.black, fontSize: 16.0),
              ),
              InkWell(
                child: Icon(
                  Icons.audiotrack,
                  color: Colors.green,
                  size: 30.0,
                ),
              )
            ],
          ),

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.