首页 > 解决方案 > 如何在列表选项卡颤动的尾随​​部分添加两个按钮

问题描述

我想要列表选项卡尾部的两个按钮,但是按钮溢出了我也想增加列表选项卡的高度,我不想减小按钮大小这里是图像

在此处输入图像描述

这是我的代码

 TabBarView(
            controller: _tabcontroller,
            children: <Widget>[
             // Text("HEllofghgfhgfhgfhgfh"),
              ListView(
                children: <Widget>[
                  Card(

                    elevation: 6.0,
                    child: ListTile(

                      leading:  Container(
                          height: 70,
                          width: 80,
                          child: Image.network(
                              "https://smartbasket.pk/image/cache/data/Bazaarapna/dairy%20product/Haleeb%20Milk%20%E2%80%93%2001%20Litre%20(Pack%20of%2012)-500x500.jpg",
                              fit: BoxFit.cover)),
                      trailing: Column(
                        children: <Widget>[
                          RaisedButton(
                            onPressed: (){},
                            child: Text('Subscription'),
                          ),
                          RaisedButton(
                            onPressed: (){},
                            child: Text('Subscription'),
                          ),
                        ],
                      ),
                      title: Text("Product Name"),
                      subtitle: Text("1 Liter \n\n RS, 115"),
                      isThreeLine: true,
                    ),
                  ),

                ],
              ),
             Text('1'),
              Text('2'),

            ],
          ),

标签: flutterflutter-layout

解决方案


Expanded你可以用Widget包裹你的两个按钮。所做的是Expanded扩展 Row、Column 或 Flex 的子项,以便子项填充可用空间。


推荐阅读