flutter - 如何在列表选项卡颤动的尾随部分添加两个按钮
问题描述
我想要列表选项卡尾部的两个按钮,但是按钮溢出了我也想增加列表选项卡的高度,我不想减小按钮大小这里是图像
这是我的代码
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'),
],
),
解决方案
Expanded
你可以用Widget包裹你的两个按钮。所做的是Expanded
扩展 Row、Column 或 Flex 的子项,以便子项填充可用空间。
推荐阅读
- kubernetes - 非 Root 用户 Helm 和 AKS
- javascript - 将对象数组的数组注入到对象数组中
- selenium - 发布管道上的 Selenium Test .net core 3.1 具有框架不匹配
- x86 - 移位 AVX2 寄存器中的值,从另一个寄存器中获取最后一个
- ios - 使用 AVFoundation 拍摄的图像上的污点
- postgresql - 我的 postgresql docker 容器正在使用所有的 ram 并且表现得很奇怪
- amazon-web-services - 无服务器 (AWS) – CORS
- ios - 带有使用数组字典的部分的 SwiftUI 列表
- c++ - 如何保持 QtCreator 运行路径?
- flutter - 从导航器设置 TextEditingController 的值